Repository navigation
Exempt labd/* actions from pinact min-age - #1
Merged
Merged
Conversation
Pass a pinact config (written to RUNNER_TEMP) instead of the min_age input. The config keeps a 7 day minimum release age for all actions but sets it to 0 for actions owned by labd, so our own fresh releases are not rejected org-wide for a week.
Instead of replacing a repository's pinact config, detect it using pinact's discovery order and merge it with the org policy: repo settings (files, ignore_actions, separator, ghes, rules) are kept, min_age is raised to at least 7 days with always: true, repo rules that lower min_age below that are dropped, and the labd/* exemption is appended. Configs with a schema version other than 3 are used as-is with PINACT_MIN_AGE enforcing the org minimum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The org-wide security workflow runs pinact with
min_age: 7, which rejects any pinned action whose commit is younger than 7 days. That also applies to our own actions: e.g.labd/gh-actions-typescriptv1.1.0 would be rejected in every repo for a week, blocking adoption of our own fixes.What
min_age: 7input. It becomes the--min-ageCLI flag, which takes precedence over config rules (precedence:--min-age>rules[].min_age> top-levelmin_age), so no exemption is possible while it is set.$RUNNER_TEMP/pinact.yaml(this workflow runs in the context of the target repo, so files in.github-workflowsare not available) and passes it via the action'sconfiginput.verify_min_age: trueis set as well.How a repository's own pinact config is handled
The step looks for the repo's config using pinact's own discovery order (
pkg/configfindProjectConfigPathin pinact v4.0.0):.pinact.yaml,.github/pinact.yaml,.pinact.yml,.github/pinact.yml.version: 3,min_age: {value: 7, always: true}, plus the labd rule).version: 3: merged withyq(preinstalled on ubuntu-latest):files,ignore_actions,separator,ghes,rules.filespatterns are rewritten to stay relative to the original config's directory, because pinact resolves them relative to the config file.min_age.value= max(repo value, 7);min_age.always=true.min_ageis lower than 7 have that override removed (the rule is dropped if nothing else is left in it). A::warningannotation reports this. Rules that raisemin_ageare kept.ActionRepoOwner == "labd"→min_age: 0rule is appended last.PINACT_MIN_AGE=7is exported so every action, labd included, must be at least 7 days old, and a::warningis logged. For a v2 config pinact itself then fails, exactly as it does in that repo's own pinact run (and onmaintoday).Policy choice: repos can't lower the org minimum for specific third-party actions through
rules. The org check exists to enforce a cooldown on third-party releases, and allowing per-repo exemptions would make it opt-out. Only first-partylabd/*actions are exempt, and that is set centrally. Repos can still make it stricter. Known escape hatch:ignore_actions/rules[].ignore: trueare honoured (e.g.terraform-aws-static-siteignoreslabdigital-main/.*). Those skip pinning altogether and are visible in review.Current repo configs:
nextjs-basic-auth-middleware(.github/pinact.yaml: min_age 7 + its own labd rule) ends up equivalent to the org default.terraform-aws-static-site(.pinact.yaml: ignore_actions) keeps its ignore.Security note
labd/*actions are first-party: we review and release them ourselves, so the cooldown (meant to protect against compromised third-party releases) adds nothing for them. Third-party actions keep the 7-day minimum, and repos cannot lower it.The step's script is static: no
${{ }}inrun, and values are passed viaenv. zizmor (CI's pinned image, v1.29.0) reports no findings, and the pedantic findings are the same as onmain.Testing
Local, pinact v4.0.0 (the version pinact-action v3.0.0 installs). The step script was extracted from this workflow with
yqand run with simulatedRUNNER_TEMP/GITHUB_ENV/GITHUB_OUTPUT, thenpinact --config <path> run --fix=false --verify --verify-min-age. The test workflow pinslabd/gh-actions-typescript/pnpm-installv1.1.0 (2026-10-25),stefanzweifel/git-auto-commit-actionv7.2.1 (2026-10-22) andactions/checkoutv7.0.1 (2026-07-17)..github/pinact.yaml(real).pinact.yaml(real) +labdigital-main/private-action@main.github/pinact.yml(files, separator" # ", ignore_actions,ignorerule, rule lowering stefanzweifel to 0, rule raising checkout to 200)filesnot scanned ✔, separator ✔, ignores ✔.pinact.yamlControls with the repo config ignored (org default only): terraform fixture fails on
labdigital-main/private-action@main("action can't be pinned"); the synthetic fixture also scansexcluded.yamland fails on the ignored actions. Both confirm the merge is what keeps the repo settings. Fallback semantics:PINACT_MIN_AGE=7 --verify-min-agewith a plain v3 config rejects both labd and stefanzweifel.Note: the "Security Checks" check on this PR runs the org-required workflow from
main, so it does not exercise this change. It takes effect after merge.