Repository navigation
ci: patched PyPI publish action, checkouts without the job token, actions.lock - #294
Open
Totara-thib wants to merge 3 commits into
Open
Totara-thib wants to merge 3 commits into
Totara-thib wants to merge 3 commits into
Conversation
The publish job pins the action at dc37677, which is v1.14.2. The comment next to it still said v1.14.0: the last bump moved the commit and left the comment. GHSA-5xjx-3w67-w9x9 (critical) covers every version up to 1.14.2. The action bundled the emSign root CA through certifi, the trust store that Sigstore uses for Trusted Publishing and the attestations. 1.14.3 is the first patched release. Between the two tags the action's pinned requirements and its Dockerfile change, action.yml and its inputs do not. The comment now has the plain form of the other pins.
actions/checkout keeps the job token on the runner until the end of the job, in a file under $RUNNER_TEMP, so that later steps can run authenticated git commands. No job here pushes with it, and four of them hand the runner to a coding assistant right after the checkout. One of those tokens can write to the repository. What each job does without it: - ci, docs, the release build and the Copilot setup steps have no git step after the checkout. - conformance and codex-review fetch from origin again. That fetch is anonymous now, which a public repository allows. - codex.yml posts its comment through github-script with github.token, which does not come from the checkout. - The other two assistant workflows use an action that puts its own git credentials on the remote before the model runs.
.github/workflows/actions.lock is GitHub's workflow dependency lockfile, written by gh actions-lock. It was generated with --no-narrow, so no workflow file changes: every action stays pinned by its commit, with the version in the comment. The commit pins already fix what runs, including the five actions that the pinned ones call, which are pinned by commit in turn. The lockfile adds two checks that GitHub makes when a job starts: the repository behind each name is still the one recorded here (owner and repository ids), and each commit belongs to the recorded tag in the action's own repository, not to a fork of it. The publish action generates a local container action at run time. The tool cannot follow it and locks the publish action itself. Dependabot updates the matching entry in the same pull request as its bump. The action bumps that are open today were prepared before the file existed, so they need a rebase before they merge. This commit stands alone and can be dropped without touching the other two.
Contributor
[Medium impact] The reviewed changes appear safe to merge; no actionable issues were found. Reviews (1) · Last reviewed commit: "ci: record the pinned actions in actions..." · Reviewed by Greptile |
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.
Hi, some CI hardening contribution:
The
publishjob uploads to PyPI withpypa/gh-action-pypi-publishat v1.14.2, an action version with a published advisory: up to 1.14.2 it ships the now-revoked emSign root CA in the trust store Sigstore uses for Trusted Publishing (GHSA-5xjx-3w67-w9x9, critical).Dependabot will not bring it yet: it raises no alert for an action pinned by commit, and its five open action bumps are the default limit.
Three commits:
conformanceandcodex-reviewthen fetch anonymously.actions.lock, GitHub's workflow dependency lockfile fromgh actions-lock --no-narrow: your pins stay as written. It adds a check that each commit belongs to the action's repository. Open Dependabot bumps need a rebase after. Happy to drop it.The release and assistant jobs do not run on this PR.
Found and fixed with Plumber (E 30/100 before, A 100/100 after), reviewed and submitted by me.