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
head-check: make the required check impossible for a pull request to rewrite (base-pinned job + GitHub App) #34
The head-check action (fork-ci/actions/head-check, PR #33) is meant to be a required check: a pull request may only merge when its head is the change the reviewers read.
But it runs on pull_request, and a pull_request run uses the workflow files of the pull request itself. So anyone who can push a branch can change the job, or add another job with the same name that always passes. Then the required check is green without anyone having read the change.
GitHub's ruleset rule "Require workflows to pass" would stop this, but it is only for organizations on paid plans. Repositories owned by a user account (this fork, and the projects that use it) cannot use it.
Today the README says this plainly, and the stopgap is: a person reads every pull request that changes .github/workflows/ or the action's files.
Proposed fix (future work)
A pull_request_target job that runs the check from code pinned on the base branch, never the pull request's own code. It reads the pull request only as data (no checkout of PR code that runs).
The job posts its result (a commit status or check run) through a separate GitHub App. The App's private key lives in a GitHub environment that only the base branch may use, so a pull request's workflow cannot read it.
The branch ruleset's required check is bound to that App as its only allowed source, so a job in a pull request that uses the same name does not count.
Questions to settle first
Where the App runs its token exchange (an action step with the key from the environment is enough; no server needed).
How the queue (pr-queue) re-runs it after a lens comment is posted (pull_request_target has no comment trigger; issue_comment or a re-run from the ready command).
Whether this stays general: the App and its environment are project setup; the workflow is a reusable one in this fork.
Activity
docs(fork): gate trust, what the head gate proves and the owner's ste…
docs(fork): gate trust, what the head gate proves and the owner's ste…
fork-kit/gh-apps: host install kit for GitHub App tokens (gate-trust …
fork-ci: head gate, the head check as a gate App's check run (#34) (#85)
docs(fork): gate trust, what the head gate proves and the owner's ste…