@@ -55,10 +55,13 @@ jobs:
5555 current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
5656 echo "Current version: $current_version"
5757 echo "REVISION=$current_version" >> $GITHUB_ENV
58+ # Pre-populate UPDATED_VERSION so downstream condition works even if bump step is skipped
59+ echo "UPDATED_VERSION=$current_version" >> $GITHUB_ENV
5860 shell : bash
5961
6062 - name : Check and Update Version
61- if : github.ref == 'refs/heads/develop'
63+ # Run on both develop and internal-repo branches
64+ if : ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/internal-repo' }}
6265 id : check-and-update-version
6366 run : |
6467 current_version=${{ env.REVISION }}
7982 git config --local user.email "github-actions@github.com"
8083 git add pom.xml
8184 git commit -m "Increment version to ${new_version}"
82- git push origin HEAD:develop
85+ current_branch="${GITHUB_REF#refs/heads/}"
86+ echo "Pushing version bump to $current_branch"
87+ git push origin HEAD:${current_branch}
8388 else
8489 echo "Current version already contains -SNAPSHOT, no update needed."
8590 fi
9499 shell : bash
95100
96101 - name : Deploy snapshot
97- if : ${{ endsWith(env.UPDATED_VERSION, '-SNAPSHOT') }}
102+ # Deploy only if we have a snapshot version
103+ if : ${{ env.UPDATED_VERSION && endsWith(env.UPDATED_VERSION, '-SNAPSHOT') }}
98104 run : |
99105 mvn -B -ntp -fae -Dmaven.install.skip=true -Dmaven.test.skip=true -DdeployAtEnd=true -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/cap-java/sdm deploy
100106 env :
0 commit comments