Skip to content

Commit 6b88971

Browse files
committed
[Build] Make staging of relevant files robust against file absence
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
1 parent 9e7f462 commit 6b88971

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/checkVersions.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ jobs:
4949
- name: Commit version increments, if any
5050
run: |
5151
set -x
52-
git add '*/META-INF/MANIFEST.MF' '*/feature.xml' '*/pom.xml'
52+
# Only stage files relevant for version increments and don't fail if the kind of file to be staged does not exist at all.
53+
git add '*/META-INF/MANIFEST.MF' || true
54+
git add '*/feature.xml' || true
55+
git add '*/pom.xml' || true
5356
if [[ $(git diff --name-only --cached) != '' ]]; then
5457
# Relevant files were staged, i.e. some version were changed
5558

0 commit comments

Comments
 (0)