Skip to content

ci: pin actions to commits and stop persisting checkout tokens - #10

Merged
ashtonian merged 2 commits into
masterfrom
ci/harden-workflows
Oct 29, 2026
Merged

ashtonian merged 2 commits into
masterfrom
ci/harden-workflows

Conversation

@ashtonian

@ashtonian ashtonian commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Pin every action to the commit its tag resolved to, with the version in a
comment, so a moved tag cannot change what runs on the self-hosted runners.
Repository settings will require full commit SHAs.

Checkouts no longer persist the job token in .git/config, where build and
test code could read it; no step pushes with it.

Dependabot keeps the pinned actions current, proposing a release only once
it is 7 days old.

Moves Go jobs to go-ci-actions v1.1.0 and the cluster runners' shared Go build cache; jobs that run it get id-token: write so the cache accepts their uploads. The release job builds with cache-mode: off, so published binaries never come from cached objects.

Test plan

  • actionlint clean
  • zizmor: no unpinned-uses or artipacked findings
  • every pinned SHA is a commit matching its version comment (checked through the GitHub API)
  • CI on this PR

Pin every action to the commit its tag resolved to, with the version in a
comment, so a moved tag cannot change what runs on the self-hosted runners.
Repository settings will require full commit SHAs.

Checkouts no longer persist the job token in .git/config, where build and
test code could read it; no step pushes with it.

Dependabot keeps the pinned actions current, proposing a release only once
it is 7 days old.
go-ci-actions v1.1.0 uses the cluster runners' shared, RAM-backed Go build
cache when the runner provides one, and keeps only modules in the GitHub
cache. Jobs that run it get id-token: write: the cache accepts uploads only
with the job's OIDC token, and stores a pull request's in a namespace of its
own. Hosted runners keep using the GitHub cache.

The release job builds with cache-mode: off: published binaries never come
from cached objects, which any repository's default branch can write.
@ashtonian
ashtonian merged commit 505584b into master Oct 29, 2026
5 checks passed
@ashtonian
ashtonian deleted the ci/harden-workflows branch October 29, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant