Repository navigation
fix(ci): simplify fork PR handling in running-in-ci skill - #1457
Merged
Merged
Conversation
…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]>
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bot has pushed to
originon 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 saysgit push origindespite never being told to.gh pr checkoutalready 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 usegit push, matching the guidance already indeveloping-codeandgithub-gitlab.Closes #1434.