Clarify push_to_pull_request_branch behavior for multi-checkout workflows#36238
Conversation
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
push_to_pull_request_branch behavior for multi-checkout workflows
There was a problem hiding this comment.
Pull request overview
This PR clarifies how push_to_pull_request_branch should be used in multi-checkout GitHub Actions workflows and adds tests to ensure PR-comment prompt assembly includes (or omits) the push-to-PR-branch guidance based on configuration.
Changes:
- Expanded
safe_outputs_push_to_pr_branch.mdwith explicit guidance for multi-checkout layouts (operate from the target repo checkout andcdinto it before runninggit). - Added assertions in
unified_prompt_step_test.goto verify the PR-comment guidance section is injected only whenpush-to-pull-request-branchis configured.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/unified_prompt_step_test.go | Adds focused tests verifying conditional injection of push-to-PR-branch guidance for PR-comment workflows. |
| actions/setup/md/safe_outputs_push_to_pr_branch.md | Documents multi-checkout operational steps so agents run git in the correct checkout before pushing. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #36238 does not have the 'implementation' label (has_implementation_label=false) and has only 44 new lines in business logic directories, which is below the 100-line threshold (requires_adr_by_default_volume=false). No custom design-gate config overrides apply. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
🧪 Test Quality Sentinel completed test quality analysis. |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /zoom-out and /tdd — approving with two minor suggestions.
📋 Key Themes & Highlights
Key Themes
- Example specificity: The hardcoded
$GITHUB_WORKSPACE/githubpath is idiomatic to this repo and may mislead agents in other repos — a generic placeholder would travel better. - Event coverage: The positive test only exercises
issue_comment; worth either expanding or commenting on whether other PR event types are intentionally excluded.
Positive Highlights
- ✅ Clear, concise documentation addition — directly addresses the silent failure mode described in the PR
- ✅ Solid complementary test pair: positive (guidance present) + negative (guidance absent) covers the injection contract cleanly
- ✅ Tight
EnvVarsassertion prevents accidental changes to the conditional expression
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 1.2M
There was a problem hiding this comment.
🔎 Code quality review by PR Code Quality Reviewer · sonnet46 1.5M
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics & Test Classification (2 tests analyzed)
Test Classification Details
Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract.
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). Both sub-tests verify behavioral contracts, build tag is present, no mocks used, and all assertions include descriptive messages.
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ded test coverage - Replace repo-specific path example with generic description - Replace ambiguous cd instruction with subshell/pushd guidance - Add pull_request_review_comment trigger test case - Add SafeOutputs: nil negative test case
push_to_pull_request_branchalready supports cross-repo checkouts, but prompt guidance was not explicit enough in multi-checkout layouts (e.g., editing/pushing from$GITHUB_WORKSPACE/github). This update makes the operational path explicit so agents reliably run git commands in the correct checkout before invoking the safe-output push tool.Prompt guidance (agent-facing)
actions/setup/md/safe_outputs_push_to_pr_branch.mdwith explicit multi-checkout instructions:cdinto that checkout before git operationsPrompt section behavior coverage
pkg/workflow/unified_prompt_step_test.goto verify PR-comment prompt assembly:push-to-pull-request-branchis configured