Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ self-hosted-runner:
- yoga
- perf-solo
- merge-queue
- pr-gate
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
# can reproduce.
/opt/fleet-bin/bin/yamllint --version
/opt/fleet-bin/bin/yamllint -d relaxed .github/workflows/
- name: pr-gate runs-on lint
shell: bash
run: bash scripts/lint-pr-gate-runs-on.sh
- name: actionlint
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# the job only reads `context.payload` and calls the API. If a checkout step is
# ever added, this decision must be revisited.
timeout-minutes: 22
runs-on: [self-hosted, Linux, X64, clean-room, intel]
runs-on: [self-hosted, Linux, X64, clean-room, intel, pr-gate]
permissions:
pull-requests: write
steps:
Expand Down
16 changes: 16 additions & 0 deletions scripts/lint-pr-gate-runs-on.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# lint-pr-gate-runs-on.sh -- the pr-gate `authorize` job must ask for the pr-gate runner label,
# and no workflow here may ask for a GitHub-hosted runner (paiml/infra#231, #1859; paiml/rmedia#1192).
set -uo pipefail
cd "$(dirname "$0")/.." || exit 2
W=.github/workflows/pr-gate.yml
rc=0
# runs-on line of the authorize job: first `runs-on:` after the ` authorize:` key
line=$(awk '/^ authorize:/{f=1} f && /^ runs-on:/{print; exit}' "$W")
if [ -z "$line" ]; then echo "lint-pr-gate-runs-on: FAIL: no runs-on found for the authorize job in $W"; rc=1
elif ! grep -qE '[[,] *pr-gate *[],]' <<<"$line"; then
echo "lint-pr-gate-runs-on: FAIL: authorize runs-on lacks the pr-gate label: $line"; rc=1; fi
if grep -nE '^\s*runs-on:.*(ubuntu-|windows-|macos-)' .github/workflows/*.yml; then
echo "lint-pr-gate-runs-on: FAIL: a workflow asks for a GitHub-hosted runner"; rc=1; fi
[ "$rc" -eq 0 ] && echo "lint-pr-gate-runs-on: OK (authorize carries pr-gate; no hosted runner)"
exit "$rc"
Loading