Repository navigation
ci(ecosystem-gate): reject a pull request head as the dispatched consumer ref - #164
Merged
Merged
Conversation
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.
A manual dispatch of the ecosystem gate checks the consumer out at
consumer_refand 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 onworkflow_dispatchwhenconsumer_refstarts withrefs/pull/orpull/. 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-stepalerts on this workflow (#2, #3) point atmatrix.consumer.extra_ref, not at this input. CodeQL matched that field by its name (.*(head|branch|ref).*), and its value is committed config:masteror a reviewed companion-pin branch. I dismissed both as false positives with that reason.Checked:
actionlintpasses. The case statement rejectsrefs/pull/5/headandpull/5/headand allowsfeat/x,masterand an empty input (bash -euo pipefail).