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
13 changes: 10 additions & 3 deletions .github/workflows/route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ on:
description: 'GitHub App id. Default is the ROUTACT_APP_ID variable.'
type: string
required: false
runs-on:
description: 'Runner for the route job itself, as JSON (a label or a label array). Default is the ROUTACT_ROUTER_RUNS_ON variable, else "ubuntu-slim".'
type: string
required: false
secrets:
ROUTACT_APP_PRIVATE_KEY:
required: false
Expand All @@ -66,9 +70,12 @@ on:

jobs:
route:
# The smallest, fastest-starting GitHub-hosted runner. Never self-hosted:
# the router must not depend on the pool it is checking.
runs-on: ubuntu-slim
# The smallest, fastest-starting GitHub-hosted runner by default. Set the
# runs-on input or the ROUTACT_ROUTER_RUNS_ON variable to route from a
# runner that does not use GitHub's minutes, such as Blacksmith. Never use
# a pool the router checks: it could not route away from that pool when it
# is full.
runs-on: ${{ fromJSON(inputs.runs-on || vars.ROUTACT_ROUTER_RUNS_ON || '"ubuntu-slim"') }}
timeout-minutes: 3
env:
HAS_APP_KEY: ${{ secrets.ROUTACT_APP_PRIVATE_KEY != '' }}
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ The check reads the organization's [billing usage summary](https://docs.github.c
- GitHub updates billing usage with a delay, so a few jobs can still start on paid minutes right after the included minutes run out.
- The check counts the whole organization. Public repositories use GitHub-hosted runners for free, so do not route them through a pool that ends on a self-hosted runner.

### Where the route job runs

The reusable workflow runs the route job on GitHub's `ubuntu-slim`. When a private repository's GitHub-hosted minutes are used up and the spending limit is reached, GitHub does not start that job, so nothing can be routed. To route from a runner that does not use GitHub's minutes, set the org variable `ROUTACT_ROUTER_RUNS_ON` (or the `runs-on` input) to a JSON label or label array:

```sh
gh variable set ROUTACT_ROUTER_RUNS_ON --org your-org --body '"blacksmith-2vcpu-ubuntu-2404"'
```

Do not point it at a self-hosted pool that the router checks. When that pool is full, the route job would wait behind the jobs it is meant to route away from.

### Fork pull requests

Fork PRs skip the primary and every fallback step labelled `self-hosted`. Other checks still run, so a fork PR can use Blacksmith when it is enabled.
Expand Down
Loading