harden: pin action SHAs, fail closed on missing base-ref - #5
Open
chiruu12 wants to merge 1 commit into
Open
Conversation
Greptile SummaryThis PR hardens the composite scan action and its CI setup. The main changes are:
Confidence Score: 5/5This looks safe to merge after a small input-validation cleanup.
action.yml Important Files Changed
Reviews (1): Last reviewed commit: "harden: pin action SHAs + base-ref prefl..." | Re-trigger Greptile |
| env: | ||
| BASE_REF: ${{ inputs.base-ref }} | ||
| run: | | ||
| if ! git rev-parse --verify --quiet "origin/${BASE_REF}^{commit}" >/dev/null; then |
There was a problem hiding this comment.
Revision Syntax Bypasses Ref Check
When base-ref contains git revision syntax such as main^ or main~1, this check verifies origin/main^ as a valid commit instead of requiring the literal remote branch origin/main. The scan then runs against the caller-supplied revision expression, which can expand the diff to commits outside the PR and produce incorrect scan results.
This was referenced Jun 25, 2026
Merged
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.
From the cross-repo review — supply-chain + fail-open hardening for the composite action.
Changes
action.yml,ci.yml):astral-sh/setup-uv@…#v7,actions/setup-python@…#v6,actions/checkout@…#v6— were floating on major tags (supply-chain drift risk).action.yml): new preflight runsgit rev-parse --verify origin/<base-ref>and exits 1 with a clear::error::if it's absent (shallow checkout or wrong branch). Previously this produced an empty diff and the scan silently passed (exit 0).action.yml: thedescription:contained an unquotedfetch-depth: 0(:breaks strict YAML parsers); now quoted.>=0.4.0,<0.5(matches the action default).Notes / follow-ups (tracked as issues)
.github/skip) lives inunplug.cli.scan_prin the SDK and is handled in a separate SDK PR.Test plan
base-refis missing