From 1ce13c8a963d5ffab46a6e5ae87df4ce28965851 Mon Sep 17 00:00:00 2001 From: Okan Sahin Date: Wed, 24 Jul 2024 16:30:13 +0200 Subject: [PATCH 1/2] Correct error messages for duplicate files --- .github/workflows/merge-to-stage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-to-stage.js b/.github/workflows/merge-to-stage.js index e081251f20..ae522f21b8 100644 --- a/.github/workflows/merge-to-stage.js +++ b/.github/workflows/merge-to-stage.js @@ -130,9 +130,10 @@ const merge = async ({ prs, type }) => { for await (const { number, files, html_url, title } of prs) { try { - if (files.some((file) => SEEN[file])) { + const duplicateFile = files.find((file) => SEEN[file]); + if (duplicateFile) { commentOnPR( - `Skipped ${number}: ${title} due to file "${file}" overlap. Merging will be attempted in the next batch`, + `Skipped ${number}: "${title}" due to file "${duplicateFile}" overlap. Merging will be attempted in the next batch`, number ); continue; From f86e25580fbaa7bcd15bdc32d37efa8f5c2f560f Mon Sep 17 00:00:00 2001 From: Okan Sahin Date: Wed, 24 Jul 2024 16:33:27 +0200 Subject: [PATCH 2/2] Improved variable naming --- .github/workflows/merge-to-stage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-to-stage.js b/.github/workflows/merge-to-stage.js index ae522f21b8..b3dd6b3e7e 100644 --- a/.github/workflows/merge-to-stage.js +++ b/.github/workflows/merge-to-stage.js @@ -130,10 +130,10 @@ const merge = async ({ prs, type }) => { for await (const { number, files, html_url, title } of prs) { try { - const duplicateFile = files.find((file) => SEEN[file]); - if (duplicateFile) { + const fileOverlap = files.find((file) => SEEN[file]); + if (fileOverlap) { commentOnPR( - `Skipped ${number}: "${title}" due to file "${duplicateFile}" overlap. Merging will be attempted in the next batch`, + `Skipped ${number}: "${title}" due to file "${fileOverlap}" overlap. Merging will be attempted in the next batch`, number ); continue;