Skip to content

ci(ecosystem-gate): reject a pull request head as the dispatched consumer ref - #164

Merged
rennf93 merged 1 commit into
masterfrom
ci/gate-reject-pr-head-ref
Oct 21, 2026
Merged

rennf93 merged 1 commit into
masterfrom
ci/gate-reject-pr-head-ref

Conversation

@rennf93

@rennf93 rennf93 commented Oct 21, 2026

Copy link
Copy Markdown
Member

A manual dispatch of the ecosystem gate checks the consumer out at consumer_ref and builds and tests it with this repository's cache scope. Nothing stopped that ref from being a pull request head (refs/pull/N/head), which can be fork code. A first step now fails the run on workflow_dispatch when consumer_ref starts with refs/pull/ or pull/. Branches, tags, commits and the empty default still go through. Push and pull_request runs are untouched.

The input reaches the shell through env, not an inline expression, so it can't inject into the script.

The two CodeQL actions/cache-poisoning/poisonable-step alerts on this workflow (#2, #3) point at matrix.consumer.extra_ref, not at this input. CodeQL matched that field by its name (.*(head|branch|ref).*), and its value is committed config: master or a reviewed companion-pin branch. I dismissed both as false positives with that reason.

Checked: actionlint passes. The case statement rejects refs/pull/5/head and pull/5/head and allows feat/x, master and an empty input (bash -euo pipefail).

@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 21, 2026
@github-actions github-actions Bot added the ci GitHub Actions and pre-commit label Oct 21, 2026
@rennf93
rennf93 merged commit 1df2104 into master Oct 21, 2026
13 checks passed
@rennf93
rennf93 deleted the ci/gate-reject-pr-head-ref branch October 21, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci GitHub Actions and pre-commit no-issue Chore or dependency PR that does not need an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant