Skip to content

fix(ci): simplify fork PR handling in running-in-ci skill - #1457

Merged
max-sixty merged 2 commits into
mainfrom
hourly/review-22986059272
Mar 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
hourly/review-22986059272

Conversation

@worktrunk-bot

@worktrunk-bot worktrunk-bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Collaborator

The bot has pushed to origin on fork PRs three times (#1411, #1434, run 22985929574), creating stray branches on the upstream repo. The previous approach added workflow-level fork detection and system prompt injection — but the root cause is simpler: Claude says git push origin despite never being told to.

gh pr checkout already configures branch tracking to the correct remote (including fork remotes). git push (without specifying a remote) follows tracking and works correctly for both fork and non-fork PRs. The fix is just telling the CI skill to use git push, matching the guidance already in developing-code and github-gitlab.

Closes #1434.

This was written by Claude Code on behalf of @max-sixty

…rompt

Defense-in-depth for the recurring fork-PR push bug (#1434, #1411). The
skill-level instruction alone is insufficient — the model pushes to origin
before checking. Two changes:

1. Add a workflow step that detects fork PRs via `gh pr view` and sets an
   output flag before Claude runs.
2. When the flag is set, append "This is a FORK PR" to the system prompt so
   Claude sees the warning before any reasoning about pushing.
3. Move fork detection to the "First Steps" section of the running-in-ci
   skill and strengthen the Fork PRs section with recurrence history.

Evidence: run 22985929574 on PR #1401 (fork from jradtilbrook) — bot pushed
to origin creating a stray branch, then discovered the fork after the fact.
Third occurrence of this pattern.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@worktrunk-bot worktrunk-bot added the claude-behavior Issues with Claude CI bot behavior label Mar 12, 2026
…gin`

Replace fork detection workflow step and system prompt injection with
simpler guidance: always use `git push` (no remote). `gh pr checkout`
already configures branch tracking correctly for fork PRs.

Co-Authored-By: Claude <[email protected]>
@max-sixty max-sixty changed the title fix(ci): detect fork PRs in workflow to prevent origin push fix(ci): simplify fork PR handling in running-in-ci skill Mar 12, 2026
@max-sixty
max-sixty merged commit 1aee6b5 into main Mar 12, 2026
22 checks passed
@max-sixty
max-sixty deleted the hourly/review-22986059272 branch March 12, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Issues with Claude CI bot behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude-mention: fork PR push recurrence — bot ignores running-in-ci fork check (recurrence of #1411)

2 participants