Skip to content

Commit

Permalink
[Build] Commit only relevant files in version increment workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HannesWell committed Sep 28, 2024
1 parent 650d043 commit 9e7f462
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/checkVersions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for version increments and apply them if necessary
name: Check for and apply version increments

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

0 comments on commit 9e7f462

Please sign in to comment.