Skip build number commit when already up to date

The release job fails when the build number in the repo already matches
the computed value, causing git commit to exit with code 1 on an empty
changeset. Now we check for staged changes before committing.
This commit is contained in:
Arkadiusz Fal
2026-02-13 22:22:47 +01:00
parent f973f3cd91
commit 35e38a03ba

View File

@@ -205,8 +205,10 @@ jobs:
git config --local user.name "github-actions[bot]"
sed -i 's/CURRENT_PROJECT_VERSION = [0-9]*/CURRENT_PROJECT_VERSION = ${{ env.BUILD_NUMBER }}/' Yattee.xcodeproj/project.pbxproj
git add Yattee.xcodeproj/project.pbxproj
git commit -m "Bump build number to ${{ env.BUILD_NUMBER }}"
git push origin ${{ github.ref_name }}
git diff --cached --quiet && echo "Build number already up to date" || {
git commit -m "Bump build number to ${{ env.BUILD_NUMBER }}"
git push origin ${{ github.ref_name }}
}
- uses: actions/download-artifact@v4
with:
path: artifacts