Skip to content

CI: guard public self-hosted workflows against outside triggers - #197

Merged
SSFSKIM merged 4 commits into
masterfrom
workflow-trigger-guard
Oct 27, 2026
Merged

SSFSKIM merged 4 commits into
masterfrom
workflow-trigger-guard

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What this checks

Add .github/scripts/workflow-triggers.test.mjs to 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 outside push, workflow_dispatch, and schedule.

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

  • Focused node --test .github/scripts/workflow-triggers.test.mjs: 8/8 passing; the original missing-guard implementation failed 6/8.
  • Focused eslint: clean. Review regression: custom prefixes (ubuntu-ci-pool, macos-builder, windows-private) are refused; hosted label shapes are checked against GitHub runner-images and hosted/larger-runner documentation, with ubuntu-slim retained.
  • Remote scripts/ci-gate.sh /private/tmp/maws-workflow-trigger-guard --gates static --label trigger-guard: success static; ci-gate: run 40436755928 success on e944b16. Run.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)

…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)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T02:04:50.806371Z 2a5f8e7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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
SSFSKIM merged commit 989f4e5 into master Oct 27, 2026
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)
@SSFSKIM
SSFSKIM deleted the workflow-trigger-guard branch October 27, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant