Repository navigation
CI: guard public self-hosted workflows against outside triggers - #197
Merged
Merged
Conversation
…tory MAWS is public and its self-hosted runners (the Macs, ci-kit's pool) are persistent, so no workflow may both have a job whose runs-on can reach one and trigger on anything but push, workflow_dispatch or schedule. A runner's refusal at job start is no boundary: always()/failure() steps and actions' pre scripts still run. .github/scripts/workflow-triggers.test.mjs holds every file in .github/workflows to that, failing closed on any workflow, trigger or runs-on it cannot read; static's gate-scripts step collects it with the other .github/scripts tests. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…gate.yml's triggers Drop the exact assertion on gate.yml's `on` keys, which would refuse an allowed schedule trigger; the injected pull_request case and the tree's evaluation stay. The header no longer calls the pool's boxes persistent. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…s reaching The check does not follow a call into the called file, so a local ./.github/workflows/ call is no longer skipped: like a call to another repository, it reaches a self-hosted runner beside an outside trigger, and passes under push, workflow_dispatch or schedule. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…labels A label that merely starts with ubuntu-, windows- or macos- (ubuntu-ci-pool, macos-builder, windows-private) is any runner's to carry, so it now reaches a self-hosted runner. Hosted are only the shapes GitHub gives its images in actions/runner-images and the hosted and larger-runner references: ubuntu-latest/-slim/-<yy.mm>[-arm], windows-latest/-<yyyy>[-vs<yyyy>]/ -11[-vs<yyyy>]-arm, macos-latest[-large|-xlarge]/-<nn>[-large|-xlarge|-intel], xcode-<nn>[-xlarge]. Every listed label is a positive case; custom-prefix labels are negatives. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 27, 2026
… code off the owner's runners: the static trigger guard, PR #197, and the pool's backstop) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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.
What this checks
Add
.github/scripts/workflow-triggers.test.mjsto the existing static gate's gate-script test glob. It scans every YAML workflow and refuses workflows that combine a self-hosted-capable job with any trigger outsidepush,workflow_dispatch, andschedule.Self-hosted-capable includes explicit self-hosted/ci-kit labels, other custom labels (including macOS/ARM64/cpus-*), expressions, runner groups, and reusable workflow calls whose runner choice this check does not follow. Literal GitHub-hosted image labels remain permitted with other triggers. Unreadable workflows fail the check. Every diagnostic names the workflow/job and unsafe trigger.
Why
MAWS is now public by the owner's choice. Its persistent Macs and ci-kit's ephemeral Linux pool must not quietly acquire a workflow that runs outside-triggered code. The MAWS architect asked for this guard in a gate-script test so both the static gate and merge test run enforce it. A nonzero runner job-started hook is not sufficient:
always()/failure()steps and action pre scripts can still execute after hook failure. This is a static configuration guard, not runtime isolation or a replacement for repository access controls.Decision Log: gate-offload DL 124, to be written by the architect
No Decision Log edits, workflow-trigger changes, runner changes, or deployment are included. The architect will land this PR after its static gate passes.
Verification
node --test .github/scripts/workflow-triggers.test.mjs: 8/8 passing; the original missing-guard implementation failed 6/8.ubuntu-ci-pool,macos-builder,windows-private) are refused; hosted label shapes are checked against GitHub runner-images and hosted/larger-runner documentation, withubuntu-slimretained.scripts/ci-gate.sh /private/tmp/maws-workflow-trigger-guard --gates static --label trigger-guard:success static;ci-gate: run 40436755928 successon e944b16. Run.Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)