Skip to content

Commit 148a4e1

Browse files
docs(site): document target-branches and infer-target-from-checkout-ref fields (#1449)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e47bdb7 commit 148a4e1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

site/src/content/docs/reference/safe-outputs.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,19 @@ This hybrid approach combines:
270270
Note: The source branch name is auto-generated from a sanitized version of the PR title plus a unique suffix (e.g., `agent/fix-bug-in-parser-a1b2c3`). This format is human-readable while preventing injection attacks.
271271

272272
**Configuration options (front matter):**
273-
- `target-branch` - Target branch to merge into (default: "main")
273+
- `target-branch` - Target (base) branch the PR merges into (default: `"main"`). A plain literal branch name applied to every repo unless overridden by `target-branches` or `infer-target-from-checkout-ref`.
274+
- `target-branches` - Optional map of per-repository target-branch overrides, keyed by the repository alias the agent passes to `create-pull-request` (`self` or a `checkout:` alias). Highest precedence. Useful when a multi-checkout ("meta repo") agent needs to open a PR into a different base branch per repo.
275+
```yaml
276+
safe-outputs:
277+
create-pull-request:
278+
target-branch: main # default for self + any repo without an override
279+
target-branches:
280+
docs: gh-pages # PRs to the "docs" checkout always target gh-pages
281+
sdk: release/v2 # PRs to the "sdk" checkout always target release/v2
282+
```
283+
- `infer-target-from-checkout-ref` - Optional bool (default: `false`). When `true`, a checkout repo with no explicit `target-branches` entry targets its own `repos: ref` (the branch it was checked out at). `self` and repos without a known ref fall back to `target-branch`. Only branch refs (`refs/heads/*`) are valid PR targets — repos checked out at a tag ref (`refs/tags/*`) trigger a compile-time warning and should be given an explicit `target-branches` entry instead.
284+
285+
**Per-repo target resolution precedence** (for a repo alias `R`): `target-branches[R]` → (if `infer-target-from-checkout-ref`) `R`'s checkout ref → `target-branch` → `"main"`.
274286
- `draft` - Whether to create the PR as a draft (default: **true**). Set to `false` to publish the PR immediately. **Note:** `auto-complete` is silently skipped on draft PRs -- set `draft: false` when using `auto-complete: true`.
275287
- `auto-complete` - Set auto-complete on the PR (default: false). Requires `draft: false` to take effect.
276288
- `delete-source-branch` - Delete source branch after merge (default: true)

0 commit comments

Comments
 (0)