From 515315de788fb168d47a7f0ca560e7c957e36868 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 13 May 2026 14:45:50 +0700 Subject: [PATCH] fix(workflow): rebase-retry on push to handle concurrent run races --- .github/workflows/update.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index c2426cd..f021ec1 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -46,4 +46,10 @@ jobs: exit 0 fi git commit -m "chore: daily ranking refresh" - git push + # rebase + retry guards against the race where two runs commit near-simultaneously + for attempt in 1 2 3; do + if git push; then exit 0; fi + echo "push attempt $attempt rejected, rebasing on origin/main" + git pull --rebase origin main + done + exit 1