Skip to content

Commit

Permalink
[Build] Make staging of relevant files robust against file absence
Browse files Browse the repository at this point in the history
Stage the relevant kind of files in isolation and don't fail if that
kind of file does not exist at all in the repository.

Otherwise the entire step fails if the repo for example doesn't contain
a feature.xml, because the previous 'git add' command then fails with:

fatal: pathspec '*/feature.xml' did not match any files
  • Loading branch information
HannesWell committed Sep 28, 2024
1 parent 9e7f462 commit 6b88971
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/checkVersions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ jobs:
- name: Commit version increments, if any
run: |
set -x
git add '*/META-INF/MANIFEST.MF' '*/feature.xml' '*/pom.xml'
# Only stage files relevant for version increments and don't fail if the kind of file to be staged does not exist at all.
git add '*/META-INF/MANIFEST.MF' || true
git add '*/feature.xml' || true
git add '*/pom.xml' || true
if [[ $(git diff --name-only --cached) != '' ]]; then
# Relevant files were staged, i.e. some version were changed
Expand Down

0 comments on commit 6b88971

Please sign in to comment.