🔄 fix: add race condition handling to version bump pushes
Some checks failed
CI/CD Pipeline / CI Pipeline (pull_request) Has been cancelled
Some checks failed
CI/CD Pipeline / CI Pipeline (pull_request) Has been cancelled
This commit is contained in:
@@ -186,9 +186,29 @@ jobs:
|
|||||||
if [ "$VERSION_BUMPED" = "true" ]; then
|
if [ "$VERSION_BUMPED" = "true" ]; then
|
||||||
git config --global user.name "CI Bot"
|
git config --global user.name "CI Bot"
|
||||||
git config --global user.email "ci@arcodange.fr"
|
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 add VERSION cmd/server/main.go README.md
|
||||||
git commit -m "chore: auto version bump [skip ci]" || echo "No changes to commit"
|
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
|
fi
|
||||||
|
|
||||||
- name: Login to Gitea Container Registry
|
- name: Login to Gitea Container Registry
|
||||||
|
|||||||
Reference in New Issue
Block a user