Repository navigation
[docs] docs: unbloat checkout reference (-29% words) - #77595
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The reference edits omit multiple security, authorization, fail-closed, and derivation details needed to prevent invalid configurations and unsafe interpretations.
7 open issues
Document boolean and multi-mode requirements for allow-private-repos · New Retain fail-closed credential setup cases · New Retain local-generation protections against repository-controlled helpers · New Restore packed-object preview completeness and integrity checks · New Document full-recovery baselines and publisher authorization · New Avoid claiming the linked spec contains omitted derivation formulas · New Clarify acknowledge-risk does not suppress other diagnostics · New
What changed in this PR
This PR condenses the checkout reference documentation while preserving its configuration examples, frontmatter, and heading anchors.
Changes:
- Shortens introductory, policy, credential, repository-list, and checkout guidance.
- Simplifies configuration-option descriptions and runtime repository documentation.
- Condenses object-pack recovery documentation and links related details to the safe-outputs specification.
| File | Description |
|---|---|
| docs/src/content/docs/reference/checkout.md | Condensed the checkout reference documentation covering configuration, repository lists, credentials, PR checkout, recovery, and trusted target policies. |
Review effort: Lite (dynamic)
| | `multi` | boolean | Enables runtime repository-list expansion and its restrictions. Defaults to `false`; literal boolean only. | | ||
| | `allowed-repos` | string \| string[] | Mandatory allowlist for `multi: true`. Does not enable multi mode by itself. Supports scoped patterns such as `owner/*` and `*/repo`, but not `"*"` or `"*/*"`. Ignored in single-repository mode. | | ||
| | `max-repos` | integer | Maximum unique repositories per `multi: true` entry. Requires `allowed-repos` in multi mode; defaults to `10`. Must be a positive literal integer. | | ||
| | `allow-private-repos` | boolean | With `multi: true`, allow private/internal targets when the list is hosted by a private/internal repository. Defaults to `false`. Public hosts always reject non-public targets. | |
| For a central workflow repository that edits an external repository, combine `repository`, `path`, `current: true`, and checkout-scoped `github-app` authentication. The workflow repository can stay checked out for tooling. Use `permissions.contents: none` only to suppress its default checkout. Checkout credentials and safe-output publication credentials are configured separately. | ||
|
|
||
| When a checkout path contains an expression, credential setup resolves the evaluated directories at runtime. The last checkout targeting the workspace root determines its expected identity, including when an expression evaluates to `.` or an equivalent root path. Earlier root checkouts are not re-authenticated with their superseded identities. Expressions remain environment data, and a directory-resolution failure stops credential setup. | ||
| Credential setup verifies the expected checkout identity through `GH_AW_GIT_REPOSITORY`. It checks effective fetch and push URLs before and after authentication, rejects plaintext HTTP and empty identities, and fails on a mismatch rather than retargeting the checkout. If post-authentication verification fails, it restores the original remote. Workspaces without a checkout or `origin` remote skip setup. For path expressions, the last checkout targeting the workspace root determines the identity. |
|
|
||
| ### Safe-Output Patches and Object-Pack Recovery | ||
|
|
||
| Safe-output patch and bundle generation is local-only. It never fetches refs or objects from the agent-writable checkout, and it disables all Git transports, hooks, and signing during generation. Prepare required refs with `checkout.fetch` and enough history with `checkout.fetch-depth` before agent execution. Partial clones must also have the required blobs locally. Incremental updates need the pre-agent PR-head baseline recorded by the PR checkout step, or an existing `origin/<branch>` tracking ref. Missing baselines are reported rather than replaced with a broader diff. |
|
|
||
| When local generation cannot resolve required refs or objects, non-staged PR outputs can return `result: "queued"` with `recovery: "object-pack"`. This is not publication success. The agent packages available local objects without fetching. The trusted safe-outputs job then fetches the authorized baseline into a new isolated bare repository, validates the objects, and regenerates the patch and bundle under the usual file, size, and publication policies. Agent repository configuration, remotes, hooks, and alternates are never copied. | ||
|
|
||
| Recovery selects only objects reachable from the pinned tip, excluding anything reachable from local baseline hints. Hints reduce transfer size but never authorize a publisher baseline or a remote request. The default limits (100,000 objects and 64 MiB uncompressed) apply to the selected objects, not the whole repository. Recovery rejects redacted or mismatched previews. Incremental recovery requires the triggering PR's exact pre-agent head SHA; an uploaded baseline or newer remote head cannot replace it. |
|
|
||
| Recovery selects only objects reachable from the pinned tip, excluding anything reachable from local baseline hints. Hints reduce transfer size but never authorize a publisher baseline or a remote request. The default limits (100,000 objects and 64 MiB uncompressed) apply to the selected objects, not the whole repository. Recovery rejects redacted or mismatched previews. Incremental recovery requires the triggering PR's exact pre-agent head SHA; an uploaded baseline or newer remote head cannot replace it. | ||
|
|
||
| Recovery needs checkout provisioning when the event has no trusted baseline, when outputs are staged, when the selected change is large, when recovery budgets are exhausted, or when agent-created content is missing. Fallback issues keep the original uploads immutable. Their recovery commands require a clean, complete clone, and object-pack envelopes cannot be applied directly with `git fetch` or `git am`. |
| | `GH_AW_OBJECT_PACK_TIMEOUT_MS` | `60000` | Each command timeout; the shared network deadline is three times this value | | ||
| | `GH_AW_OBJECT_PACK_FETCH_DEPTHS` | `1,16,64,256,1024,4096,16384,65536` | Strictly increasing list of history search depths | | ||
|
|
||
| Budgets scale from the defaults. Derivation formulas are in the [safe-outputs specification](/gh-aw/specs/safe-outputs-specification/). For example, `gh variable set GH_AW_OBJECT_PACK_MAX_BYTES --body 134217728` raises the byte budget to 128 MiB. Larger budgets increase runner memory, CPU, and network use. No setting relaxes repository authorization, preview validation, or the rule that all fetching finishes before agent objects are imported. |
| Each `allowed-checkouts` entry requires a literal `owner/repository` and a non-empty literal branch, tag, or commit SHA. Matching is exact and case-sensitive, and repository and ref pairs cannot be combined across entries. Expressions, wildcards, and `refs/pull/...` refs are rejected. Do not set `checkout.fetch` on these checkouts, because follow-up fetches can add refs beyond the trusted checkout. Wiki checkouts are not covered. | ||
|
|
||
| `on.pull_request_target.acknowledge-risk` defaults to `false`. Setting it to `true` suppresses **only** the strict-mode dangerous-trigger warning, including for `checkout: false` or a supported base checkout. It neither allows other checkouts nor bypasses [fork-pattern validation](/gh-aw/reference/triggers/#fork-filtering-forks), actor authorization, the unrestricted-forks warning, other strict validation, or safe-update checks. An allowlist without acknowledgment still emits the trigger warning. | ||
| `acknowledge-risk` defaults to `false`. Setting it to `true` suppresses **only** the strict-mode dangerous-trigger warning. It does not allow other checkouts or bypass fork-pattern validation, actor authorization, or other strict checks. |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🎉 This pull request is included in a new release. Release: |

Summary
Removes documentation bloat from
docs/src/content/docs/reference/checkout.md. All frontmatter, examples, warnings, and heading anchors are kept, so inbound links still resolve.Changes
pull_request_targetpolicy section. Each caveat now appears once.Verification
#pull_request_target-checkout,#target-only-checkout-permissionscontents-none,#repository-configured-recovery-limits,#git-credentials-after-checkout,#checkout-and-host-step-order,#explicit-trusted-checkout-policy,#configuration-options) is unchanged.checkout.mdis modified. Prettier is not installed in this sandbox, so formatting was not checked with it.steercomments.References: none (no workflow run links apply)