Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/auto-update-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ name: auto-update-pr
on:
workflow_call:
inputs:
runs-on: {description: "Runner: a label, or a JSON array of labels (pick-runner output).", type: string, default: "ubuntu-latest"}
actions-ref:
description: "Commit of prosopo/github_actions holding the script; pass the SHA this workflow is pinned at (see cache-main.yml)."
type: string
Expand All @@ -47,7 +48,7 @@ permissions:

jobs:
update:
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cancel-runs-on-pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ name: cancel-runs-on-pr-close

on:
workflow_call:
inputs:
runs-on: {description: "Runner: a label, or a JSON array of labels (pick-runner output).", type: string, default: "ubuntu-latest"}

permissions:
contents: read
Expand All @@ -33,7 +35,7 @@ jobs:
permissions:
actions: write
contents: read
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 10
env:
GH_TOKEN: ${{ github.token }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
uses: ./.github/workflows/static.yml
with:
actions-ref: ${{ github.event.pull_request.head.sha || github.sha }}
# JSON form, as pick-runner outputs it; the fixture calls below use a plain label.
runs-on: '["ubuntu-latest"]'
# The JS here is only stage fixtures; the js job is where the
# repo-wide linters run, since every change under .github/ selects it.
js-command: pnpm run setup:lint-tools && PATH="$HOME/.local/bin:$PATH" pnpm run lint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:
description: "Commit of prosopo/github_actions whose actions this uses; pass the SHA the caller pins this workflow at (see cache-main.yml)."
type: string
required: true
runs-on: {description: "Runner label.", type: string, default: "ubuntu-latest"}
runs-on: {description: "Runner: a label, or a JSON array of labels (pick-runner output).", type: string, default: "ubuntu-latest"}

permissions:
contents: read

jobs:
housekeeping:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: "Commit of prosopo/github_actions whose actions this uses; pass the SHA the caller pins this workflow at (see cache-main.yml)."
type: string
required: true
runs-on: {description: "Runner label.", type: string, default: "ubuntu-latest"}
runs-on: {description: "Runner: a label, or a JSON array of labels (pick-runner output).", type: string, default: "ubuntu-latest"}
dependency-review-severity:
description: "Lowest severity (low, moderate, high, critical) of a newly added vulnerable dependency that fails the PR."
type: string
Expand All @@ -31,7 +31,7 @@ permissions:
jobs:
scan:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:

semgrep:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 30
container:
image: semgrep/semgrep:1.145.0
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
# head lockfiles with osv-scanner and diff (scripts/dependency_diff.py).
dependency-review:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
type: string
required: true
runs-on:
description: "Runner label for every job."
description: "Runner for every job: a label, or a JSON array of labels (pick-runner output)."
type: string
default: "ubuntu-latest"
timeout-minutes:
Expand Down Expand Up @@ -65,7 +65,7 @@ permissions:
jobs:
changes:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 5
outputs:
js: ${{ steps.detect.outputs.js-changed }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
js:
needs: changes
if: ${{ needs.changes.outputs.js == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
rust:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
python:
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
go:
needs: changes
if: ${{ needs.changes.outputs.go == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
php:
needs: changes
if: ${{ needs.changes.outputs.php == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
type: string
required: true
runs-on:
description: "Runner label for every job."
description: "Runner for every job: a label, or a JSON array of labels (pick-runner output)."
type: string
default: "ubuntu-latest"
timeout-minutes:
Expand Down Expand Up @@ -65,7 +65,7 @@ permissions:
jobs:
changes:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft) }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: 5
outputs:
js: ${{ steps.detect.outputs.js-changed }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
js:
needs: changes
if: ${{ needs.changes.outputs.js == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
rust:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
python:
needs: changes
if: ${{ needs.changes.outputs.python == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
go:
needs: changes
if: ${{ needs.changes.outputs.go == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
php:
needs: changes
if: ${{ needs.changes.outputs.php == 'true' }}
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(startsWith(inputs.runs-on, '[') && inputs.runs-on || toJSON(inputs.runs-on)) }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Each takes `actions-ref`: pass the same SHA the `uses:` line pins, so the workfl
runs-on: ${{ fromJSON(needs.runner.outputs.default) }}
```

The shared stage workflows' `runs-on` input takes either a label or this JSON, so a caller passes `runs-on: ${{ needs.runner.outputs.default }}` straight through.

Two calls in one run need distinct `workflow` or `concurrency-key` inputs, or they queue behind each other. `ci.yml`'s `selftest-pick-runner` jobs call it as above and check the output shape.
- `ci-coverage-audit.yml`: weekly (and on dispatch), the CI coverage matrix for every repo in `.github/scripts/ciaudit/repos.txt`: per unit (package, crate, Python project, Dockerfile, ...) whether CI builds, lints, typechecks, tests and e2e-tests it, from a static walk of each triggered workflow (reusable workflows, composite actions, package scripts, turbo tasks) cross-checked against its latest green run. HTML and JSON in the `ci-coverage` artifact, a text matrix in the step summary. A gap that is deliberate goes in `.github/scripts/ciaudit/optouts.json` with its reason. Run locally: `fetch.py --repos-file repos.txt --dest-prefix snap/` then `audit.py --snap-prefix snap/ --repos-file repos.txt --out-json r.json --out-html r.html`; `why.py` prints the evidence behind one unit.
- `auto-update-pr.yml`: updates one random behind, mergeable, auto-merge PR at a time (`.github/scripts/auto_update_pr.py`).
Expand Down
Loading