fix: add retry loop for gh-pages push race condition

Both APT and DNF repo update jobs push to gh-pages, and the
pages-build-deployment action also modifies it. This can cause
push failures when the ref changes between pull and push.

Added a retry loop (5 attempts with 5s delay) to handle this.

Co-Authored-By: Claude <claude@anthropic.com>
This commit is contained in:
aaddrick
2026-01-24 14:36:42 -05:00
parent 02ef5d8b4a
commit a905d4b3cf

View File

@@ -175,8 +175,12 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --staged --quiet || git commit -m "Update APT repository for ${{ github.ref_name }}"
git pull --rebase
git push
# Retry loop to handle concurrent pushes to gh-pages
for i in 1 2 3 4 5; do
git pull --rebase && git push && break
echo "Push failed, retrying in 5 seconds... (attempt $i/5)"
sleep 5
done
update-dnf-repo:
name: Update DNF Repository
@@ -279,5 +283,9 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --staged --quiet || git commit -m "Update DNF repository for ${{ github.ref_name }}"
git pull --rebase
git push
# Retry loop to handle concurrent pushes to gh-pages
for i in 1 2 3 4 5; do
git pull --rebase && git push && break
echo "Push failed, retrying in 5 seconds... (attempt $i/5)"
sleep 5
done