Repository navigation
fix(ci): the drift check would check out any ref NETWEIR_COMMIT named - #48
Merged
Merged
Conversation
A pull request can change NETWEIR_COMMIT, and the drift job checked out whatever it held. It now accepts only a full 40-character commit hash and fails on anything else, as CodeQL's untrusted-checkout check asked. Also adds the organization's avatar, the rocket mark from the README banner, as SVG and PNG under assets/.
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.
Problem. CodeQL's
actions/untrusted-checkoutcheck flagged the drift job (code scanning alert #7). The job checks outnetweir/netweirat whateverNETWEIR_COMMITholds, and a pull request can change that file. The job runs onpull_requestwith a read-only token and no secrets, so the risk was small, but nothing stopped the file naming a branch or tag instead of a commit.Change.
pinstep strips whitespace, then refuses anything that isn't a full 40-character hexadecimal commit hash, with a message saying so.assets/parsec-avatar.svgandassets/parsec-avatar.png, the rocket mark used as the organization's avatar, so its source lives in the repo.Tests. The drift job runs on this PR with the current
NETWEIR_COMMITand should pass. Given a branch name instead, thepinstep fails with the new message.