From 62ef61af0f65fef0a4017bb23be33aed768c5ec7 Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Wed, 11 Feb 2026 15:57:06 +0100 Subject: [PATCH] Do not fail workflow when token cannot push workflow-touching refs --- .github/workflows/ci-master-failure-chack-agent-pr.yml | 6 +++++- .github/workflows/pr-failure-chack-agent-dispatch.yml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-master-failure-chack-agent-pr.yml b/.github/workflows/ci-master-failure-chack-agent-pr.yml index da496c0..60d4e28 100644 --- a/.github/workflows/ci-master-failure-chack-agent-pr.yml +++ b/.github/workflows/ci-master-failure-chack-agent-pr.yml @@ -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 diff --git a/.github/workflows/pr-failure-chack-agent-dispatch.yml b/.github/workflows/pr-failure-chack-agent-dispatch.yml index e2eecb7..8ede4cb 100644 --- a/.github/workflows/pr-failure-chack-agent-dispatch.yml +++ b/.github/workflows/pr-failure-chack-agent-dispatch.yml @@ -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 != '' }}