ci: rebase and retry the image-tag commit when main has moved
CI / ci (push) Successful in 1m34s

A re-run of an older commit (or any push landing mid-build) made the
final push non-fast-forward, so the image was built but never deployed.
This commit is contained in:
bmr_bluecap committed 2026-10-23 12:37:42 -04:00
1 parent da1043e6f3
commit 93415c6852
1 file changed
+9 -1
+9 -1
View File
@@ -124,4 +124,12 @@ jobs:
git diff --cached --quiet && { echo "no image change"; exit 0; } git diff --cached --quiet && { echo "no image change"; exit 0; }
git commit -m "ci: deploy ${{ steps.tag.outputs.sha }} [skip ci]" git commit -m "ci: deploy ${{ steps.tag.outputs.sha }} [skip ci]"
git remote set-url origin "http://${{ github.repository_owner }}:${{ secrets.CI_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git" git remote set-url origin "http://${{ github.repository_owner }}:${{ secrets.CI_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git"
git push origin HEAD:main # main may have moved since checkout (a later push, or a re-run of an older commit).
# Only kustomization.yaml changes here, so rebasing onto the new tip is safe.
for attempt in 1 2 3; do
git push origin HEAD:main && exit 0
echo "push rejected (main moved); rebasing onto origin/main, attempt $attempt"
git fetch --unshallow origin main 2>/dev/null || git fetch origin main
git rebase origin/main
done
exit 1