File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 8484 git commit -m "chore(${SERVICE_NAME}): update image to ${{ steps.info.outputs.branch }}-${{ steps.info.outputs.sha }}" \
8585 -m "Triggered by: ${{ github.event.workflow_run.html_url }}"
8686
87- git push origin ${{ steps.info.outputs.branch }}
87+ # Retry loop for race conditions
88+ MAX_RETRIES=5
89+ for ((i=1; i<=MAX_RETRIES; i++)); do
90+ echo "🔄 Attempt $i of $MAX_RETRIES to push changes..."
91+ git pull --rebase origin ${{ steps.info.outputs.branch }}
92+ if git push origin ${{ steps.info.outputs.branch }}; then
93+ echo "✅ Push successful!"
94+ exit 0
95+ fi
96+ echo "⚠️ Push failed, retrying in roughly 5 seconds..."
97+ sleep $((RANDOM % 5 + 3))
98+ done
99+
100+ echo "❌ Failed to push changes after $MAX_RETRIES attempts."
101+ exit 1
You can’t perform that action at this time.
0 commit comments