Repository navigation
ci: keep runner selection on hosted pools - #48
Merged
Merged
Conversation
|
A reusable workflow cannot tell a hosted runner label from a private one: release-desktop.yml's `runner` and `verify_runner` inputs go straight into `runs-on`, so a future caller could point release jobs, which hold signing secrets, at self-hosted hardware. Validate both inputs in a GitHub-hosted job that build and verify need, rejecting `self-hosted`, `*-runner` labels, and anything outside blacksmith-*, ubuntu-*, macos-*, and windows-*. Add .github/scripts/check-runner-labels.py, which fails when any workflow references `self-hosted` or a private-runner label, with unit tests, and run it in the cheapest PR job so a pull request that introduces one fails before any other job starts. Pin expo/expo-github-action/continuous-deploy-fingerprint in the fork PR preview to the commit v9.0.1 tags instead of `main`: that job runs fork-authored code with EXPO_PREVIEW_TOKEN, so a moving ref would let a new upstream commit run there unreviewed.
ScriptedAlchemy
force-pushed
the
ci/runner-input-safety
branch
from
November 3, 2026 03:07
9fe95d2 to
10fb290
Compare
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.
Problem
Runner labels arrive from workflow YAML and flow into
runs-on. Two places take them as data:release-desktop.ymlexposesrunnerandverify_runnerasworkflow_callstring inputs and uses them directly inruns-on. Current callers pass literals (blacksmith-*,windows-*), but nothing stops a future caller from passingself-hostedor a private label, which would put a release build with signing secrets on hardware this repository does not control..github/workflows/*.ymlhas no static guard against selecting a private runner, so a pull request adding one is only caught by review.Separately, the fork PR preview (
mobile-eas-preview-fork.yml) pinnedexpo/expo-github-action/continuous-deploy-fingerprintat@mainwhile running fork-authored code withEXPO_PREVIEW_TOKEN, so a new upstream commit onmainwould run there unreviewed.Change
.github/workflows/release-desktop.yml: a newvalidatejob onubuntu-24.04checks both inputs and fails closed.buildandverifyneed it, so no job with a bad label is ever scheduled. Allowed labels are the hosted pools this workflow is built for:blacksmith-*,ubuntu-*,macos-*,windows-*;self-hostedand any*-runnerlabel are rejected. Every current caller keeps working (blacksmith-12vcpu-macos-26,blacksmith-32vcpu-ubuntu-2404,blacksmith-16vcpu-ubuntu-2404-arm,ubuntu-24.04,ubuntu-24.04-arm,macos-26,windows-2025,windows-11-arm)..github/scripts/check-runner-labels.py: scans.github/workflows/*.ymland fails onself-hostedor a private-runner label (linux-runner,windows-runner,macos-runner,bench-*), ignoring comments. The same script validates explicit labels (--runner,--verify-runner) so the predicate is defined once..github/scripts/check-runner-labels.test.pycovers both modes..github/workflows/ci.ymland.github/workflows/fork-ci.yml: run the checker and its unit tests in each workflow'schangesjob. It is the cheapest job that runs on every pull request and it runs before anything else, so a PR that introduces a private runner label fails before another job starts.ci.yml's sparse checkout now also takes.github/workflows/and the script;fork-ci.ymlalready checks out the whole tree, and it is the workflow that runs in this repository whileCIis disabled..github/workflows/mobile-eas-preview-fork.yml: pin the fingerprint deploy action to9da89d3617bb88139671bad31b09c65714c2ee06(the commitv9.0.1tags) instead of the movingmainref.No environment gates or repository settings are changed here; those are follow-ups (see below).
Scope and approval
Security hardening of existing CI configuration, no behavior change for current callers. Environment protection rules for the signing and Expo flows are deliberately not part of this change because they are repository settings, not workflow code.
Verification
ruby -ryamlparses the three changed workflow files.python3 -B .github/scripts/check-runner-labels.test.py→ 12 tests, OK.python3 -B .github/scripts/check-runner-labels.py→ passes on the tree; withruns-on: self-hostedplanted in a copy it exits 1 and names the file and line; withbench-32vcpuit exits 1.validatestep run with each caller label:blacksmith-8vcpu-ubuntu-2404,ubuntu-24.04-arm+windows-11-arm,ubuntu-24.04,windows-11-arm→ exit 0;self-hosted,bench-32vcpu,macos-26-runner,linux-runner, and an emptyrunner→ exit 1.actionlinton the three changed workflows reports exactly the same 12 pre-existing warnings asmain(Blacksmith labels unknown to its default config, one existing SC2046 in the signing step); nothing new.vp fmt --checkequivalent (oxfmt 0.74, defaults) passes on.github/workflows/*.yml; Python is not formatted by the repo tooling, matchingstage-preview-bundle.py.git diff --checkclean.vp check(dependencies are not installed in this checkout).Residual risks and follow-ups
subclaims.desktop-macos-preview-publish.ymlstill signs and notarizes with signing secrets behind a label and vouch-list gate rather than an environment with required reviewers. Adding that environment is a repository setting..github/workflows/mobile-eas-preview.yml(same-repo PRs) still usescontinuous-deploy-fingerprint@main; same pin applies if desired.Model: DeepSeek V4.1 Flash 1017 via OpenCode