Skip to content

Commit f52c0a6

Browse files
singiamtelvkucera
andauthored
[Infrastructure] Don't try to lint when no files are found (AliceO2Group#8772)
Co-authored-by: Vít Kučera <[email protected]>
1 parent 43834f1 commit f52c0a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/o2-linter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
run: |
2525
# Diff against the common ancestor of the source branch and the main branch.
2626
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
27+
if [ ${#files[@]} -eq 0 ]; then
28+
echo "::notice::No files to lint."
29+
exit 0
30+
fi
2731
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
2832
# shellcheck disable=SC2086 # Ignore unquoted options.
2933
python3 Scripts/o2_linter.py $options "${files[@]}"

0 commit comments

Comments
 (0)