🔄 fix: ensure sequential pushes work from updated HEAD
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user