Skip to content

Commit

Permalink
[Infrastructure] Don't try to lint when no files are found (#8772)
Browse files Browse the repository at this point in the history
Co-authored-by: Vít Kučera <[email protected]>
  • Loading branch information
singiamtel and vkucera authored Dec 4, 2024
1 parent 43834f1 commit f52c0a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/o2-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
run: |
# Diff against the common ancestor of the source branch and the main branch.
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
if [ ${#files[@]} -eq 0 ]; then
echo "::notice::No files to lint."
exit 0
fi
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
# shellcheck disable=SC2086 # Ignore unquoted options.
python3 Scripts/o2_linter.py $options "${files[@]}"
Expand Down

0 comments on commit f52c0a6

Please sign in to comment.