Skip to content

Commit d17d1cc

Browse files
Jammy2211claude
authored andcommitted
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K21CJX9TAgULDo1fFJtonc
1 parent 227e04f commit d17d1cc

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/queue_filing.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,17 @@ jobs:
169169
echo
170170
echo "Closes #${ISSUE}."
171171
} > /tmp/pr_body.md
172-
gh pr create --base main --head "$branch" \
173-
--title "queue filing: paper from #${ISSUE}" \
174-
--body-file /tmp/pr_body.md
175-
gh issue comment "$ISSUE" --body \
176-
"Filing PR opened: $(gh pr view "$branch" --json url --jq .url). Review and merge to complete the intake."
172+
if gh pr create --base main --head "$branch" \
173+
--title "queue filing: paper from #${ISSUE}" \
174+
--body-file /tmp/pr_body.md; then
175+
gh issue comment "$ISSUE" --body \
176+
"Filing PR opened: $(gh pr view "$branch" --json url --jq .url). Review and merge to complete the intake."
177+
else
178+
# Repo/org policy can forbid Actions-created PRs. The branch is
179+
# pushed and gated — degrade to a one-tap PR link, not a failure.
180+
gh issue comment "$ISSUE" --body \
181+
"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."
182+
fi
177183
178184
- name: Report failure on the issue
179185
if: failure()

0 commit comments

Comments
 (0)