From d17d1cc43641ab3057f34c601cf56d70557f2945 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 21 Aug 2026 17:49:29 -0400 Subject: [PATCH] fix: degrade to a one-tap PR link when policy blocks Actions PRs Third live run (#50): filing, gate and push all green; gh pr create was refused by 'GitHub Actions is not permitted to create or approve pull requests'. When that policy is on, comment the compare link instead of failing the whole filing. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01K21CJX9TAgULDo1fFJtonc --- .github/workflows/queue_filing.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/queue_filing.yml b/.github/workflows/queue_filing.yml index 2b424ba..4690558 100644 --- a/.github/workflows/queue_filing.yml +++ b/.github/workflows/queue_filing.yml @@ -169,11 +169,17 @@ jobs: echo echo "Closes #${ISSUE}." } > /tmp/pr_body.md - gh pr create --base main --head "$branch" \ - --title "queue filing: paper from #${ISSUE}" \ - --body-file /tmp/pr_body.md - gh issue comment "$ISSUE" --body \ - "Filing PR opened: $(gh pr view "$branch" --json url --jq .url). Review and merge to complete the intake." + if gh pr create --base main --head "$branch" \ + --title "queue filing: paper from #${ISSUE}" \ + --body-file /tmp/pr_body.md; then + gh issue comment "$ISSUE" --body \ + "Filing PR opened: $(gh pr view "$branch" --json url --jq .url). Review and merge to complete the intake." + else + # Repo/org policy can forbid Actions-created PRs. The branch is + # pushed and gated — degrade to a one-tap PR link, not a failure. + gh issue comment "$ISSUE" --body \ + "Filing branch pushed and gated: \`${branch}\` — but this repo's policy blocks Actions from opening PRs. Open it with one tap: ${GITHUB_SERVER_URL}/${GH_REPO}/compare/main...${branch}?expand=1 — or enable 'Allow GitHub Actions to create and approve pull requests' (Settings → Actions → General) to make this automatic." + fi - name: Report failure on the issue if: failure()