Repository navigation
fix(create-pull-request): implicitly allow default base branch when no allowed-base-branches configured - #29096
Conversation
…e-pull-request Agent-Logs-Url: https://github.com/github/gh-aw/sessions/aef12799-ee56-4005-a0bd-8fe3a95d8d1f Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot why was it refused? Isn't the default branch always the base branch by default? |
The default base branch is used when no |
|
@copilot the base branch SHOULD BE implicitely allowed when there are not allowed-base-branches specified |
…o allowed-base-branches configured Agent-Logs-Url: https://github.com/github/gh-aw/sessions/50d1f57f-838b-4b2b-9899-0f3c98d5bcb0 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit When |
There was a problem hiding this comment.
Pull request overview
Fixes create_pull_request base-branch override policy so that explicitly specifying the already-resolved default base branch (e.g. base: "main") is treated as a no-op when allowed-base-branches is not configured, rather than being rejected as an override.
Changes:
- Update base-branch override handling to implicitly allow a requested base branch when it matches the resolved default base branch and no allowlist is configured.
- Preserve existing allowlist enforcement behavior when
allowed-base-branchesis configured. - Add a unit test covering the implicit-allow (no-op) behavior.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/create_pull_request.cjs | Adjusts base-branch override validation to treat “requested base == resolved base” as a no-op when no allowlist is present. |
| actions/setup/js/create_pull_request.test.cjs | Adds a test ensuring a request with base: "main" succeeds when the resolved base is main and no allowlist is configured. |
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: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 70/100
Test Classification Details
Flagged Tests — Requires Review
|
When an agent explicitly specifies the repository's default base branch (e.g.
base: "main") in itscreate_pull_requestoutput, the request was incorrectly rejected with "Base branch override is not allowed" if noallowed-base-brancheswas configured. This happened because any non-empty explicitbasevalue was treated as an override requiring an allowlist.Change
Fixed
create_pull_request.cjsto implicitly allow the default base branch when noallowed-base-branchesis configured. When the agent-specified base branch matches the already-resolved defaultbaseBranchand no allowlist is set, it is treated as a no-op (not a true override) and all allowlist validation is skipped.When
allowed-base-branchesIS explicitly configured, the full allowlist check still applies and remains authoritative.A new test case covers the implicit-allow behaviour:
"should allow base override when it matches the default base branch and no allowed-base-branches is configured".