Repository navigation
ci: verify the mise installer before publishing and scope the check build token - #841
Open
Totara-thib wants to merge 4 commits into
Open
Totara-thib wants to merge 4 commits into
Totara-thib wants to merge 4 commits into
Conversation
The Release job and the Check build job both ran `curl https://mise.run | sh`. Whatever that URL serves runs in the Release job before `npm publish`, with the token that publishes the packages and writes to the repository, and in Check build next to the Netlify token. Both jobs now download install.sh from the mise v2026.11.12 release, check its SHA-256 and run it with MISE_VERSION set to that release. It is the script mise.run serves today (same checksum) and the mise the last Release run installed, at the same path, so the two PATH lines and the two `mise install` commands are unchanged. mise stays at 2026.11.12 until the version and the checksum are changed in both files.
check_build.yml declared no permissions, so on a pull request from a branch of this repository both jobs ran with the default token, which can write everywhere. The workflow now defaults to `contents: read`, which is all Lint commits needs. Check build keeps the four scopes its Netlify preview step uses through `github-token`: the commit comment, the pull request comment, the deployment and the commit status. The release dry run stops before it uses the token on a pull request. Pull requests from forks already ran read-only and skip the preview step.
actions/checkout keeps the job token in the git configuration for the rest of the job unless `persist-credentials: false` is set. In Release that token can write to the repository and it stayed readable by the build, the publish and the Netlify steps. Nothing relies on it. commitlint only reads the local history, the builds fetch VSCode and monaco-editor as tarballs, and semantic-release pushes the tag to a URL that carries the GITHUB_TOKEN of its own step.
The workflows referenced their actions by tags that can be moved: `actions/checkout@v7`, `jdx/mise-action@v4`, `nwtgck/actions-netlify@v4.0` and `@v3.0`, `actions/stale@v8`. `gh actions-lock` writes .github/workflows/actions.lock, GitHub's workflow dependency lockfile, with the commit each action resolves to, and narrows each ref to the exact version behind it. The five commits are the ones the tags point to today and the ones the last runs used. Once the file exists a workflow only runs the commits recorded in it. After a change to a `uses:` line, run `gh actions-lock` again and commit the result.
This branch has not been deployed
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.
Hello there, 4 CI hardening contributions:
curl https://mise.run | sh, run unchecked. Both now check the SHA-256 ofinstall.shfrom the mise v2026.11.12 release before running it: the same script and mise as your last release, fixed until those lines change.check_build.ymldeclared nopermissions: nowcontents: read, plus the four scopes the Netlify preview uses.actions.lock, GitHub's workflow dependency lockfile fromgh actions-lock, records the commit behind each action, which followed movable tags. Refs become exact versions, same commits as today.A changed installer or moved tag runs with what its job holds (the tj-actions incident, CVE-2025-30066), here the identity publishing 188 npm packages.
Your
ci/harden-github-actionsbranch pins the same commits, and a lockfile needsgh actions-lockafter every bump: say so and I rebase on that branch without it.Check build runs the new install lines here,
release.ymlonly at release. An allowed-actions policy listing tags needsowner/action@*.Found and fixed with Plumber (C 52/100 before, up to A 100/100 after), reviewed and submitted by me.