File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,14 +59,28 @@ jobs:
5959 --m5-series-count "${{ inputs.m5_series_count }}" \
6060 --backtest-windows "${{ inputs.backtest_windows }}"
6161
62- - name : Commit output
62+ - name : Commit output (retry-safe for concurrent runs)
6363 run : |
6464 git config user.name "github-actions[bot]"
6565 git config user.email "github-actions[bot]@users.noreply.github.com"
6666 git add site/src/data/forecasts
6767 git commit -m "Add forecast ${{ inputs.slug }}" || echo "No changes"
68- git pull --rebase origin main
69- git push
68+
69+ # Concurrent workflow runs can race on push. Retry with rebase.
70+ for i in 1 2 3 4 5; do
71+ echo "Push attempt $i..."
72+ git fetch origin main
73+ git rebase origin/main || { git rebase --abort; }
74+ if git push origin HEAD:main; then
75+ echo "Push succeeded on attempt $i"
76+ break
77+ fi
78+ if [ "$i" -eq 5 ]; then
79+ echo "Push failed after 5 attempts"
80+ exit 1
81+ fi
82+ sleep $((RANDOM % 5 + 2))
83+ done
7084
7185 - name : Setup Node for site build
7286 uses : actions/setup-node@v4
You can’t perform that action at this time.
0 commit comments