Skip to content

ci: push fix branches instead of attempting gh pr create - #1317

Open
abueide wants to merge 2 commits into
masterfrom
abueide/no-actions-pr-create
Open

ci: push fix branches instead of attempting gh pr create#1317
abueide wants to merge 2 commits into
masterfrom
abueide/no-actions-pr-create

Conversation

@abueide

@abueide abueide commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

GitHub Actions cannot create pull requests in this org — confirmed by a real run against issue #1309, where gh pr create failed with "GitHub Actions is not permitted to create or approve pull requests." I tried enabling the usual repo-level fix ("Allow GitHub Actions to create and approve pull requests") via the API and got rejected outright: "The enterprise does not allow GitHub Actions to create or approve pull requests." This is a hard block above repo/org admin level.

This applies identically to both claude-doc-sync.yml and claude-issue-investigate.yml — neither had ever actually reached its gh pr create step in a real run before now, so this was a latent bug in both.

Considered routing around it with a dedicated PAT (a human-authenticated token isn't subject to the enterprise's Actions-specific restriction), but decided against circumventing an org-level policy that was presumably set deliberately.

Fix: both workflows now push the fix branch and stop — no gh pr create attempt. Each writes a result file (doc-sync-result.md / investigation-report.md) containing a ready-to-click compare link (.../compare/base...branch?expand=1) so a maintainer can open the PR themselves in one click, uploaded as a job artifact same as before. Also drops pull-requests: write from both workflows' permissions, since neither reads or writes PR data anymore — only contents: write to push the branch.

Follow-up commit, based on that same real #1309 run's output: the investigation prompt now requires a genuine proof of fix rather than an assertion:

  • Step 2 asks for a real regression test in the appropriate existing test file (not a throwaway script) that fails on current code for the reported reason.
  • Step 4 requires re-running that test after the fix and reporting both results — failing before, passing after — as evidence, mirroring what Claude already did unprompted on the chunk() returns a sparse array when one event exceeds maxKB, stalling the event queue (regression in 2.23.0) #1309 run (it verified its 3 new tests were "not vacuous" by checking they failed without the fix and passed with it).
  • Steps 3, 5, 6, and 8 now explicitly forbid presenting a guess as a finding: if the root cause, the fix, or the reproduction is uncertain, the report must say so and state what's needed to resolve it, rather than filling the gap with speculation.

🤖 Generated with Claude Code

abueide and others added 2 commits August 28, 2026 12:15
GitHub Actions cannot create pull requests in this org - it's blocked
at the enterprise level (confirmed via a real run against issue #1309:
`gh pr create` failed with "GitHub Actions is not permitted to create
or approve pull requests", and a repo-level API attempt to enable it
was rejected with "The enterprise does not allow..."). This applied to
both claude-doc-sync.yml and claude-issue-investigate.yml identically,
and neither had ever actually reached that step in a real run before.

Rather than routing around the restriction with a PAT, both workflows
now just push the branch and stop. Each writes a result file (
doc-sync-result.md / investigation-report.md) with a ready-to-click
compare link (.../compare/base...branch?expand=1) so a maintainer can
open the PR themselves in one click. Drops pull-requests: write from
both workflows' permissions - neither reads or writes PR data anymore.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Step 2 now asks for a real regression test in the appropriate existing
test file (not just a throwaway script) that fails on current code for
the same reason the issue describes. Step 4 requires re-running that
same test after the fix and reporting both results (failing before,
passing after) as evidence the fix addresses the diagnosed cause,
rather than just asserting the fix is correct.

Steps 3, 5, 6, and 8 now explicitly forbid presenting a guess as a
finding: if the root cause, the fix, or the reproduction itself is
uncertain, the report must say so plainly and state what information
or access is needed, rather than filling the gap with speculation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant