Goal
Expand the action-pin tooling in ci-tools beyond strict tag-pin verification, so it can:
- Inventory pinned actions without hitting the API (fast audits).
- Validate branch-pinned actions (e.g.
@main) and report drift from branch HEAD.
- Surface available upgrades for tag- and branch-pinned actions, so we can review pins periodically without waiting on dependabot.
Context: homebrew-tap just SHA-pinned Homebrew/actions/setup-homebrew@main (upstream has no tagged releases). Dependabot cannot track branch-SHA pins, so we need tool-supported visibility into drift.
Scope
Extend validate-action-pins:
--list flag: print every uses: <owner>/<repo>@<ref> in the provided files with no API calls. Works on SHA pins and tag/branch pins alike. Useful for audits and piping into other tools.
- Branch-ref support: accept a branch hint in the comment (e.g.
# main) and verify via /git/ref/heads/<branch>. Use /repos/{owner}/{repo}/compare/{pinned-sha}...{head-sha} to report "N commits behind HEAD" so stale branch pins are visible without being a hard failure.
New sibling tool (proposed name: check-action-updates):
- Scans the same workflow files and, for each pinned action, reports the most recent semver tag (newest tag matching the current major, plus absolute latest) and the branch HEAD for branch pins.
- Output is a compact diff-style report — suitable for a scheduled workflow that opens an issue when upgrades are available.
Outcome
- Branch pins become maintainable: drift from HEAD is observable without manual
gh api calls.
- Periodic upgrade audits can be scripted (e.g. a
cron workflow that files an issue per stale pin).
--list gives a fast, API-free inventory for ad-hoc review.
Notes
Reasoning for splitting upgrade reporting into a separate tool: "verify pins are consistent" and "report available upgrades" are different jobs. Bundling them behind flags bloats the flag surface and muddies exit-code semantics (upgrade-available is informational; pin-mismatch is a failure). Separate binaries keep each tool focused.
Driving use case: knight-owl-dev/homebrew-tap#50 — SHA-pinning in that repo surfaced the branch-pin staleness gap.
Goal
Expand the action-pin tooling in
ci-toolsbeyond strict tag-pin verification, so it can:@main) and report drift from branch HEAD.Context:
homebrew-tapjust SHA-pinnedHomebrew/actions/setup-homebrew@main(upstream has no tagged releases). Dependabot cannot track branch-SHA pins, so we need tool-supported visibility into drift.Scope
Extend
validate-action-pins:--listflag: print everyuses: <owner>/<repo>@<ref>in the provided files with no API calls. Works on SHA pins and tag/branch pins alike. Useful for audits and piping into other tools.# main) and verify via/git/ref/heads/<branch>. Use/repos/{owner}/{repo}/compare/{pinned-sha}...{head-sha}to report "N commits behind HEAD" so stale branch pins are visible without being a hard failure.New sibling tool (proposed name:
check-action-updates):Outcome
gh apicalls.cronworkflow that files an issue per stale pin).--listgives a fast, API-free inventory for ad-hoc review.Notes
Reasoning for splitting upgrade reporting into a separate tool: "verify pins are consistent" and "report available upgrades" are different jobs. Bundling them behind flags bloats the flag surface and muddies exit-code semantics (upgrade-available is informational; pin-mismatch is a failure). Separate binaries keep each tool focused.
Driving use case: knight-owl-dev/homebrew-tap#50 — SHA-pinning in that repo surfaced the branch-pin staleness gap.