Do not fail workflow when token cannot push workflow-touching refs

This commit is contained in:
Carlos Polop
2026-02-11 15:57:06 +01:00
parent b6c4474c27
commit 62ef61af0f
2 changed files with 9 additions and 2 deletions

View File

@@ -140,7 +140,11 @@ jobs:
exit 0
fi
git commit -m "Fix CI-master failures for run #${{ github.event.workflow_run.id }}"
git push origin HEAD:"$FIX_BRANCH"
if ! git push origin HEAD:"$FIX_BRANCH"; then
echo "Push failed (likely token workflow permission limits); skipping PR creation."
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "pushed=true" >> "$GITHUB_OUTPUT"
- name: Create PR to master

View File

@@ -195,7 +195,10 @@ jobs:
exit 0
fi
git commit -m "Fix CI failures for PR #${PR_NUMBER}"
git push origin HEAD:${TARGET_BRANCH}
if ! git push origin HEAD:${TARGET_BRANCH}; then
echo "Push failed (likely token workflow permission limits); leaving run successful without push."
exit 0
fi
- name: Comment with Chack Agent result
if: ${{ steps.run_chack.outputs.final-message != '' }}