CI: fail incomplete action pin validation - #1953
Open
mattjohnsonpint wants to merge 1 commit into
Open
mattjohnsonpint wants to merge 1 commit into
mattjohnsonpint wants to merge 1 commit into
Conversation
The validation loop runs in a pipeline subshell, so pin mismatches do not affect the final status. Enable lastpipe so status updates remain in the current shell. Empty or invalid GitHub API responses also produce an empty eval command that succeeds. Require successful curl and jq validation instead.
mattjohnsonpint
commented
Sep 1, 2026
Comment on lines
+47
to
+48
| if curl --fail --silent --show-error -H "Accept: application/vnd.github+json" \ | ||
| "https://api.github.com/repos/$action/commits/$tag" | jq -e --arg hash "$hash" '.sha == $hash' >/dev/null |
Contributor
Author
There was a problem hiding this comment.
An alternative would be to avoid the GitHub API and jq by checking the remote tag with Git directly.
Suggested change
| if curl --fail --silent --show-error -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/$action/commits/$tag" | jq -e --arg hash "$hash" '.sha == $hash' >/dev/null | |
| if git ls-remote --exit-code "https://github.com/$action.git" \ | |
| "refs/tags/$tag" "refs/tags/$tag^{}" | | |
| grep -q "^$hash[[:space:]]" |
Let me know which approach you prefer.
dolmen
approved these changes
Sep 2, 2026
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.
Summary
Ensure the GitHub Actions pin validation check fails when validation cannot be completed successfully.
Changes
Update
.ci.ghactions.sh:lastpipe.curl --fail.jq -eto validate the returned commit SHA withouteval.Motivation
The validation loop previously ran in a pipeline subshell, so setting its failure status did not affect the script’s exit status. Empty or invalid GitHub API responses could also produce an empty
evalcommand that succeeded. Together, these issues allowed action pin validation to report success without validating every pin.