Skip to content

Commit 9e7f462

Browse files
committed
[Build] Commit only relevant files in version increment workflow
Do not just commit every changed file in order to avoid accidental commits of resources changed or generated during builds. For version increments only the following files are relevant: - META-INF/MANIFEST.MF - feature.xml - pom.xml
1 parent 650d043 commit 9e7f462

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/checkVersions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check for version increments and apply them if necessary
1+
name: Check for and apply version increments
22

33
on:
44
workflow_call:
@@ -49,15 +49,15 @@ jobs:
4949
- name: Commit version increments, if any
5050
run: |
5151
set -x
52-
if [[ $(git status --ignore-submodules --porcelain) != '' ]]; then
53-
# Workspace is not clean, i.e. some version were changed
52+
git add '*/META-INF/MANIFEST.MF' '*/feature.xml' '*/pom.xml'
53+
if [[ $(git diff --name-only --cached) != '' ]]; then
54+
# Relevant files were staged, i.e. some version were changed
5455
5556
# Read 'releaseNumberSDK' property as stream version
5657
streamVersion=$(mvn help:evaluate -Dexpression=releaseNumberSDK --quiet -DforceStdout)
5758
5859
git config --global user.email '${{ inputs.botMail }}'
5960
git config --global user.name '${{ inputs.botName }}'
60-
git add --all
6161
git status
6262
git commit -m "Version bump(s) for ${streamVersion} stream"
6363

0 commit comments

Comments
 (0)