File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2525 - name : Get changed JavaScript files
2626 id : get_files
2727 run : |
28- CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.js')
28+ CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.js' | xargs -I {} sh -c 'test -f "{}" && echo "{}"' )
2929 echo "files<<EOF" >> $GITHUB_ENV
3030 echo "$CHANGED_FILES" >> $GITHUB_ENV
3131 echo "EOF" >> $GITHUB_ENV
3838 run : |
3939 echo "Linting the following files:"
4040 echo "$files"
41- echo "$files" | xargs npx eslint
41+ if [ -n "$files" ]; then
42+ echo "$files" | xargs npx eslint
43+ else
44+ echo "No existing JavaScript files to lint."
45+ fi
You can’t perform that action at this time.
0 commit comments