Repository navigation
Conversation
The GitHub runner read operator policy only from Action inputs and CLI options, so a local or hosted operator had to repeat the same trust scope, command prefix, upstream workflows, dependency accounts, bump flag, and checks on every invocation. `GitHubSettings` now extends a restricted policy source: the already-loaded Landing YAML may set those names, while task inputs, caller identity, event context, run identity, delivery keys, and the database stay with the invocation. Priority is explicit options, `INPUT_*`, YAML, then defaults; a missing file preserves the previous behavior. The CLI loads execution settings before constructing the event options so the existing YAML data covers both. This first commit keeps the same CLI, Action, and runner path and documents the admitted names.
|
Landing: allow · 1ace89e No blocking findings; the new candidate commit only tightens the trusted-policy recipe, and the added guidance matches both |
The composite Action declared released defaults for `trust`, `command-prefix`, `bump-on-failure`, and `dependency-update-actors`, and its step maps every input to `INPUT_*`. GitHub fills those defaults, so a hosted run always exported non-empty values that outranked the new YAML layer: a documented `trust: owner` resolved to `repository` and admitted write collaborators. Those four inputs now default to empty and keep the previous value in their description. The CLI already supplies the identical released defaults, so an omitted input defers to Landing YAML and then to the default, while an explicit workflow value, including `false` or a concrete actor list, still wins. Task inputs keep their non-empty or dynamic defaults. The regression tests read the shipped action.yml, export its declared defaults exactly as the composite step does, and assert YAML policy applies, explicit overrides win, and a missing file keeps released behavior. A hosted `trust: owner` run now skips a write collaborator and admits the owner. A metadata check keeps every declared input mapped.
Duty's two Action steps repeated the same model, endpoint, completion, and timeout environment, so a model or endpoint change meant editing both and could drift. The job now sets that static, non-secret environment once and the steps carry only their differing policy. The duty steps also take `trust` from the one repository variable through the Action's now-empty default instead of restating `repository`. Main keeps its step-scoped environment and drops `run-id` and `checked-revision`, which the Action already derives from the native run and `github.sha`. Distinct upstream workflow allow-lists stay separate. Task inputs, secrets, checkout refs, concurrency, and token boundaries are unchanged.
The GitHub runner section stated the Action's empty policy defaults twice, in the precedence paragraph and again under the example. Keep the statement next to the example that relies on it so a later default change has one place to update.
…e admission separate
| run: | | ||
| mkdir -p "$RUNNER_TEMP/policy" | ||
| policy="$RUNNER_TEMP/policy/landing.yml" | ||
| git show "$POLICY_REVISION:.github/landing.yml" > "$policy" |
There was a problem hiding this comment.
This recipe fails as written. actions/checkout defaults to fetch-depth: 1, so on a pull_request event the base commit object is not fetched (the default checkout fetches refs/pull/N/merge at depth 1). git show "$POLICY_REVISION:.github/landing.yml" then exits 128, and under the runner's default bash -eo pipefail shell the preparation step fails before LANDING_CONFIG is written, so the job stops before the Action runs. The same abort happens when the base revision predates the file, which the next paragraph asks readers to fall back from gracefully.
Reproduced on the fetch shape actions/checkout uses: git init + git fetch --depth 1 origin refs/pull/1/merge, then the snippet verbatim gives fatal: could not get object info for the base commit and exit 128; the same snippet against a full-history clone of that repository exits 0. A base revision without the file gives fatal: path '.github/landing.yml' exists on disk, but not in '<sha>', also exit 128.
Add fetch-depth: 0 to the checkout in the example, and guard the miss the way the repository's own feedback job does: write the file only when git show succeeds, otherwise remove it, emit a warning, and skip the LANDING_CONFIG export so the documented defaults apply.
There was a problem hiding this comment.
Fixed at b31c622: the snippet now sets fetch-depth: 0 and guards the lookup. Replayed verbatim under bash -eo pipefail against a fixture repo whose refs/pull/1/merge was fetched the way actions/checkout fetches it: with full history the git show from github.event.pull_request.base.sha succeeds and the step writes LANDING_CONFIG to GITHUB_ENV; with a depth-1 fetch, and with a base revision that predates the file, the if takes the else branch, rm -f removes the truncated file, LANDING_CONFIG stays unset and the step exits 0. Unset is also safe here, since the CLI default is ~/.landing/config.yml, so no candidate-controlled file is read.
Purpose
Let the GitHub Action read operator policy from Landing YAML, and move this repository's static workflow policy there. The allow-list is
command_prefix,trust,upstream_workflow,bump_on_failure,dependency_update_actors, andcheck. Task inputs, native identity, event context, and credentials stay with the invocation.Policy inputs in the bundled Action declare empty defaults, so an omitted
with:entry falls through to Landing YAML and then the released default instead of being shadowed by a duplicated default in the Action. An explicit non-empty value, includingfalse, still wins. This fixestrust: ownerresolving torepositoryon the hosted path.Shared workflow policy
.github/landing.ymlis the single static policy file for both repository workflows, loaded throughLANDING_CONFIG:model_timeout_seconds: 120replaces three workflow environment assignments.bump_on_failure: truereplaces a|| 'true'default in the workflow expression. The step now passes the variable alone, so an explicitfalsestill overrides the file.dependency_update_actorsholds the staticdependabot[bot]/renovate[bot]base. The additivedependency-update-actor-additionsinput lets a run union identities it only learns at runtime, such as the authenticated publisher, without replacing the base.dependency-update-actorskeeps replacement semantics; blank or whitespace-only additions add nothing.modes.{gatekeeper,issuer,bumper}.instructionshold the static review, triage, and dependency-maintenance policy that used to live in workflowinstruction:text. The system prompt already appends mode instructions after the mode skill, so methods are not replaced. Workflow instructions now carry only event evidence: native check results, selected scope, and release conclusion.LANDING_COMPLETION_ARGSno longer carries a redundant|| '{}', becausecompletion_argsalready defaults to{}.Safety properties
.github/landing.ymlfrom the base commit into the runner temp directory and pointsLANDING_CONFIGthere, so candidate files cannot supply privileged policy. A job that checks out the default branch reads the checked-in file directly.upstream-workflowvalues. They are distinct admission boundaries, so they are never combined into one allow-list, and the release step passesbump-on-failure: falseexplicitly so shared duty policy cannot widen it.LANDING_API_KEYis not job-wide. No provider values are written into YAML.permissions, job and stepif:,concurrency, checkout, artifact upload, tool setup, Git identity defaults consumed before Landing runs, and the job-levelvars.LANDING_BUMP_ON_FAILURE != 'false'gate, which cannot read YAML.Documentation
The public README is a short entry point: purpose, a minimal CLI quick start, one Action snippet, supported entry points, configuration pointers, limits, and links. The site landing page is a task-oriented index. Reference pages stay canonical and carry the replacement-versus-additive actor contract and the per-step
workflow_runboundary.Two corrections in this pass:
bash -eo pipefailshell from aborting, removes the empty file, emits a warning, and leavesLANDING_CONFIGunset so the documented defaults apply. This covers both a present base file and one that predates the file.fix,review, andbumprather thanexplainortriage.Verification
Documentation-only changes;
action.yml,.github/,src/,tests/, andpyproject.tomlare unchanged, so the earlier functional results still apply.Executed in this pass, exit code checked directly:
uv run zensical build -s— no issues (exit 0), including the generated API schema export.uv run ruff check .anduv run ruff format --check .— clean (exit 0).docs/— no problems.bash -eo pipefailagainst an offline fixture: with the base file present it copies the trusted content and exportsLANDING_CONFIG; with the file absent, or with a shallow checkout, it emits the warning, leaves no policy file, and does not exportLANDING_CONFIG. All cases exit 0. The pre-fix form fails these cases with exit 128 and a zero-byte file.Not verified: a live hosted Action, provider, or model run; no CI rerun. These checks do not establish end-to-end delivery. The branch is unmerged.