You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preview setup leaves a pull request head reached through a shell variable unverified instead of refusing it #3992
harper preview setup checks the preview workflow for a token-holding job that checks out the pull request's head. Since #3807, a head value that reaches a git command through the shell is reported as unverified rather than refused. That covers a value through an assignment (REF="$SHA", REF=${{ github.event.pull_request.head.sha }}), read, for or printf -v, and an env: value that some script in the job also names. The operator can pass allow_unverified=true to go ahead.
That is deliberate, per Kris's review of #3807. Which value a command uses depends on the step's shell, the order of assignments, and which earlier step wrote GITHUB_ENV. Treating any of those as proof refused safe workflows with an error that cannot be acknowledged. But it also means a workflow that plainly checks out the head through a binding gets an overridable warning, not a refusal.
The same rule is broad in the other direction: any mention of the variable's name in a script that is not a read of it, such as # verify SHA or echo "SHA is $SHA", counts as possibly setting it. That turns a head an env: value names outright into an unverified entry. It is broad on purpose, since shell has more ways to set a variable (read, for, printf -v, a GITHUB_ENV write) than a list would hold, and a missed one would be a refusal the operator cannot get past.
Possible improvement: refuse a binding whose scope and order setup can establish. For example, the only assignment of the variable in the same step, at top level, before the git line, with nothing between them that could reassign it. Leave everything else unverified.
It fails safe: setup still stops without allow_unverified=true and names the command it could not verify.
Activity