diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index cc6720b..65a7955 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -121,6 +121,9 @@ jobs: for i in 1 2 3; do if git push; then echo "Successfully updated coverage badge to ${COVERAGE}%" + # Update local repo to the new HEAD after successful push + git fetch origin + git reset --hard origin/${{ github.ref_name }} break else echo "Push attempt $i failed, retrying..." @@ -128,6 +131,9 @@ jobs: echo "Final push attempt failed - another job may have updated the badge" git pull --rebase || true git push || echo "Recovery push also failed" + # Ensure we're on the latest commit even if push failed + git fetch origin + git reset --hard origin/${{ github.ref_name }} fi sleep 2 fi