Repository navigation
ci: harden GitHub Actions workflows - #102
Open
nantoniazzi wants to merge 2 commits into
Open
nantoniazzi wants to merge 2 commits into
nantoniazzi wants to merge 2 commits into
Conversation
A tag can be moved to point at other code if the action repository is compromised. Each action is pinned to the commit its tag points at today, so behavior is unchanged, with the version kept in a comment for Dependabot and readers.
semantic-release authenticates through the GITHUB_TOKEN env var, so the checkout does not need to leave the token in .git/config where dependency install scripts could read it. Install scripts stay enabled because native or prepare-time dependencies of this package need them.
nantoniazzi
force-pushed
the
ci/harden-github-actions
branch
from
November 23, 2026 16:12
15379a2 to
e5abee4
Compare
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.
What
This repository publishes an npm package from GitHub Actions: the
releaseworkflow (started by hand) builds the package and runs semantic-release with theNPM_TOKENandGITHUB_TOKENsecrets. This PR hardens those workflows against a compromised third-party action or dependency, without changing what they do:actions/checkout@fbc6f39… # v5.1.0). Each SHA is the commit the current tag already points to, so behavior is identical..git/config(persist-credentials: falseon checkout). semantic-release authenticates through theGITHUB_TOKENenvironment variable, as its documentation recommends.Why
CodinGame received a sales email from a CI/CD security vendor pointing at this pattern across our public repositories. An outsider cannot trigger these release workflows: they only run on
workflow_dispatchor on pushes by people with write access, and pull requests from forks run without secrets. The remaining risk is indirect, the same one behind the tj-actions (March 2025) and Shai-Hulud (2025) incidents:.git/configbyactions/checkout, or tamper withnode_modulesbefore semantic-release runs withNPM_TOKEN.Notable decisions
prepreparestep that need them (e.g. canvas, node-pty, kerberos, downloaded extensions), so--ignore-scriptswould break the build. Only the token persistence is removed here.NPM_TOKENis still used. The next step is npm trusted publishing (OIDC, no long-lived token), which needs the package to be configured on npmjs.com first; it will come in a follow-up PR.--ignore-scriptsor the missing persisted credentials break something, the job fails before publishing anything, and reverting this commit restores the previous behavior.Evidence
git ls-remote --tagsshowed the moving tag (v5,v4…) and the pinned exact tag resolve to the same commit.