diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index cdadcedb3f1d..bd7cd362f4f3 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -244,7 +244,7 @@ function detectReactComponent(code) { function detectFunction(changedFiles) { console.log('detectFunction', changedFiles); - const filteredFiles = _.filter(changedFiles, (file) => file.name && (file.name.endsWith('.js') || file.name.endsWith('.jsx') || file.name.endsWith('.ts') || file.name.endsWith('.tsx'))); + const filteredFiles = _.filter((changedFiles), ({ filename }) => filename.endsWith('.js') || filename.endsWith('.jsx') || filename.endsWith('.ts') || filename.endsWith('.tsx')); return _.some(filteredFiles, (file) => detectReactComponent(file.body)); } diff --git a/.github/actions/javascript/authorChecklist/newComponentCategory.js b/.github/actions/javascript/authorChecklist/newComponentCategory.js index 9449f3ec7473..4f27c6fe0d7b 100644 --- a/.github/actions/javascript/authorChecklist/newComponentCategory.js +++ b/.github/actions/javascript/authorChecklist/newComponentCategory.js @@ -44,7 +44,7 @@ function detectReactComponent(code) { function detectFunction(changedFiles) { console.log('detectFunction', changedFiles); - const filteredFiles = _.filter(changedFiles, (file) => file.name && (file.name.endsWith('.js') || file.name.endsWith('.jsx') || file.name.endsWith('.ts') || file.name.endsWith('.tsx'))); + const filteredFiles = _.filter((changedFiles), ({ filename }) => filename.endsWith('.js') || filename.endsWith('.jsx') || filename.endsWith('.ts') || filename.endsWith('.tsx')); return _.some(filteredFiles, (file) => detectReactComponent(file.body)); }