Skip to content

Commit 74ec3e2

Browse files
committed
Handle concurrent submodule-sync pushes with queue and retry
1 parent 7248a25 commit 74ec3e2

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/workflows/sync-submodules.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
permissions:
1717
contents: write
1818

19+
concurrency:
20+
group: submodule-sync-main
21+
cancel-in-progress: false
22+
1923
jobs:
2024
sync:
2125
runs-on: ubuntu-latest
@@ -63,4 +67,14 @@ jobs:
6367
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6468
git add "${{ steps.submodule.outputs.path }}"
6569
git commit -m "Update ${{ steps.submodule.outputs.path }} submodule pointer"
66-
git push origin main
70+
71+
for attempt in 1 2 3; do
72+
if git push origin main; then
73+
exit 0
74+
fi
75+
git fetch origin main
76+
git rebase origin/main
77+
done
78+
79+
echo "Failed to push submodule pointer after retries."
80+
exit 1

0 commit comments

Comments
 (0)