Skip to content

ci: fix coverage/benchmarks on fork PRs, and keep PR refs out of run scripts - #262

Open
orshih6 wants to merge 2 commits into
prooflinedev:mainfrom
orshih6:chore/dependency-and-ci-hardening
Open

orshih6 wants to merge 2 commits into
prooflinedev:mainfrom
orshih6:chore/dependency-and-ci-hardening

Conversation

@orshih6

@orshih6 orshih6 commented Nov 19, 2026 •

Copy link
Copy Markdown

Two related fixes in ci.yml, plus one in the build action:

1. Coverage and benchmarks fail on every fork PR. After benchmarking or measuring the base, the jobs went back with git checkout ${{ github.head_ref }}. On a fork PR that branch exists only in the fork, so the step fails with pathspec '<branch>' did not match any file(s) known to git. #259 fails this way, and so did this PR's first run. They now return to $GITHUB_SHA, the commit actions/checkout already fetched.

2. PR refs were expanded straight into shell scripts. github.head_ref is the PR author's branch name. github.base_ref and the build action's inputs.target now go through env: and are quoted, as GitHub's hardening guide recommends, and head_ref is no longer used. This is hardening, not a live vulnerability: the jobs run on pull_request, so a fork PR has no secrets and a read-only token.

Checked with actionlint (the two "github.head_ref is potentially untrusted" errors are gone; the existing determine-changes warnings are unrelated) and zizmor (the 12 template-injection errors in these files are gone).

The dependency advisories in Cargo.lock are already covered by #261, so this PR leaves them out.

🤖 Generated with Claude Code

orshih6 and others added 2 commits November 19, 2026 11:19
github.head_ref is the PR author's branch name and was expanded straight
into run: scripts in the benchmark and coverage jobs. Pass it, base_ref and
the build action's target input through environment variables and quote
them, as GitHub's hardening guide recommends. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a fork PR the head branch exists only in the fork, so
'git checkout <head_ref>' failed with 'pathspec did not match' and the
coverage and benchmark jobs failed for every outside contributor (prooflinedev#259
too). Return to $GITHUB_SHA, the commit actions/checkout already fetched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@orshih6 orshih6 changed the title ci: pass branch refs and build target to scripts through env ci: fix coverage/benchmarks on fork PRs, and keep PR refs out of run scripts Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant