Skip to content

Keep the checkout token off disk, and pin the release action to a commit - #76

Merged
ww-mw merged 1 commit into
mainfrom
harden-release-checkout-and-action-pin
Oct 12, 2026
Merged

ww-mw merged 1 commit into
mainfrom
harden-release-checkout-and-action-pin

Conversation

@ww-mw

@ww-mw ww-mw commented Oct 12, 2026

Copy link
Copy Markdown
Member

Two hardening changes to the workflows, from the security sweep after the code-scanning alerts were closed. Neither changes what CI or a release builds.

1. persist-credentials: false on checkout, in release.yml and ci.yml. By default actions/checkout keeps the job's GITHUB_TOKEN in a credentials file that git config points at, so every later step can read it, npm ci's dependency install scripts included. In release.yml that token can write (contents: write, to create the Release). No step there uses git with it: the release action takes the token as an input and calls the API. ci.yml gets the same setting. It runs the same npm ci on every pull request, so this PR's own CI proves the install needs no stored credentials before a release depends on that.

2. softprops/action-gh-release pinned to a commit. It is a third-party action that runs holding the release's write token, and it was referenced by the movable tag v3. It is now @efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3, the commit v3 and v3.0.3 point at today (resolved through the GitHub API: the v3 tag object dereferences to that commit, and v3.0.3 is the latest release, published 2026-08-30). First-party actions/checkout and actions/setup-node stay on their major tags.

Checked: both files still parse, and step for step they equal the old ones except for the checkout with: and the release action's uses:. The job names are unchanged. release.yml itself only runs on a tag, so its first exercise is the next release; the checkout change in it is the same one this PR's CI runs.

actions/checkout persists the job's GITHUB_TOKEN by default, in a credentials file that
git config points at, so every later step can read it, npm ci's install scripts included.
In release.yml that token can write (contents: write, to create the Release), and no step
uses git with it: the release action takes the token as an input and talks to the API.
Checkout now sets persist-credentials: false there, and in ci.yml too, which runs the same
npm ci on every pull request and so proves the install needs no stored credentials before
a release relies on it.

softprops/action-gh-release is a third-party action that runs holding that write token,
and it was pinned by the movable tag v3. It is now pinned to efb35369, the commit v3 and
v3.0.3 point at today, so a moved tag cannot change what runs in a release.
@ww-mw
ww-mw merged commit f7a94a4 into main Oct 12, 2026
4 checks passed
@ww-mw
ww-mw deleted the harden-release-checkout-and-action-pin branch October 12, 2026 00:38
@ww-mw ww-mw mentioned this pull request Oct 12, 2026
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