diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index 9b488f0b172d..3a899312a257 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -272,7 +272,13 @@ async function detectReactComponentInFile(filename) { ; async function detectFunction(changedFiles) { const filteredFiles = _.filter((changedFiles), ({ filename }) => filename.endsWith('.js') || filename.endsWith('.jsx') || filename.endsWith('.ts') || filename.endsWith('.tsx')); - return Promise.race(_.map(filteredFiles, ({ filename }) => detectReactComponentInFile(filename))); + for (const file of filteredFiles) { + const result = await detectReactComponentInFile(file.filename); + if (result) { + return true; // If the check is true, exit directly + } + } + return false; }; module.exports = { diff --git a/.github/actions/javascript/authorChecklist/newComponentCategory.js b/.github/actions/javascript/authorChecklist/newComponentCategory.js index 069b81fe53a4..91cbcb29aabc 100644 --- a/.github/actions/javascript/authorChecklist/newComponentCategory.js +++ b/.github/actions/javascript/authorChecklist/newComponentCategory.js @@ -71,7 +71,13 @@ async function detectReactComponentInFile(filename) { ; async function detectFunction(changedFiles) { const filteredFiles = _.filter((changedFiles), ({ filename }) => filename.endsWith('.js') || filename.endsWith('.jsx') || filename.endsWith('.ts') || filename.endsWith('.tsx')); - return Promise.race(_.map(filteredFiles, ({ filename }) => detectReactComponentInFile(filename))); + for (const file of filteredFiles) { + const result = await detectReactComponentInFile(file.filename); + if (result) { + return true; // If the check is true, exit directly + } + } + return false; }; module.exports = {