diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-04-20 17:51:53 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-26 14:18:38 +0200 |
commit | 82a17d028dd9981199c537110b0eb4d3fd7e0558 (patch) | |
tree | 43ed8e052e6305c30421d41eabaeb18044f18064 | |
parent | f241b17804c27874333a14816edc7466f85ca043 (diff) |
CI: Fixup failure to get changed files on merge
The checkout might be too shallow so the before commit isn't available.
The logic was already written to take this into account (it then generates
an empty 'changed.txt' which falls back to testing everything), but the
error code would still force terminate the job.
Hopefully we can find a way to make the logic work for merge events too in
the future, but for now this is a quick fix.
(cherry picked from commit 9063e907a7db07d0d59f3f649b27d39eae56b94b)
-rw-r--r-- | .github/workflows/static_checks.yml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 8ef49c4539..635c2514fa 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -30,9 +30,9 @@ jobs: id: changed-files run: | if [ "${{ github.event_name }}" == "pull_request" ]; then - files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} 2> /dev/null) + files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} 2> /dev/null || true) elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then - files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null) + files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true) fi echo "$files" >> changed.txt cat changed.txt |