🔄 fix: add race condition handling to version bump pushes
Some checks failed
CI/CD Pipeline / CI Pipeline (pull_request) Has been cancelled

This commit is contained in:
2026-04-07 08:16:15 +02:00
parent c609a4ca48
commit a4153b8554

View File

@@ -186,9 +186,29 @@ jobs:
if [ "$VERSION_BUMPED" = "true" ]; then
git config --global user.name "CI Bot"
git config --global user.email "ci@arcodange.fr"
# Set up credentials using Gitea token
git config --global credential.helper store
echo "https://${{ secrets.PACKAGES_TOKEN }}@gitea.arcodange.lab" > ~/.git-credentials
git add VERSION cmd/server/main.go README.md
git commit -m "chore: auto version bump [skip ci]" || echo "No changes to commit"
git push
# Try push with retry logic for race conditions
for i in 1 2 3; do
if git push; then
echo "Successfully bumped version"
break
else
echo "Version bump push attempt $i failed, retrying..."
if [ $i -eq 3 ]; then
echo "Final version bump push attempt failed - another job may have bumped version"
git pull --rebase || true
git push || echo "Version bump recovery push also failed"
fi
sleep 2
fi
done
fi
- name: Login to Gitea Container Registry