diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 739b059..cc6720b 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -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