Skip to content

feat(runner): runs-on from CI_RUNS_ON in every job, runner setup that survives restarts - #14

Merged
leonardocandiani merged 1 commit into
mainfrom
feat/runner-ci-runs-on
Sep 23, 2026
Merged

leonardocandiani merged 1 commit into
mainfrom
feat/runner-ci-runs-on

Conversation

@leonardocandiani

Copy link
Copy Markdown
Owner

Two problems found while moving the segsmartdev repos to a self-hosted pool after the GitHub Actions minutes ran out.

1. The config's runner was ignored by CI. ci.yml.template and pr-auto-merge.yml.template had runs-on: ubuntu-latest hardcoded; only the review, mention and triage workflows used {{RUNNER}}. A repo set to self-hosted still burned hosted minutes on lint, types and tests.

Now {{RUNNER}} renders to ${{ fromJSON(vars.CI_RUNS_ON || '"ubuntu-latest"') }} and every job in those two templates uses it. The runner is picked per repo at run time: gh variable set CI_RUNS_ON --body '["self-hosted","linux","vps"]' moves the repo, gh variable delete CI_RUNS_ON is the kill switch. Deploy templates stay on ubuntu-latest on purpose (docker-ghcr needs a Docker design of its own).

Proven on segsmartdev/proteauto-admin (PR 81): with the variable, the 4 CI jobs and the 3 review jobs ran green on node01 runners; after deleting it and re-running, the same jobs were routed to ubuntu-latest (and blocked by billing, which is the routing proof); after setting it again, green on node01.

2. setup-self-hosted-runner.sh built runners that die on the first restart. It passed a one-hour registration token and kept the registration in the container's writable layer. Two runners created with it (node02) are in a restart loop with "Cannot configure the runner because it is already configured". The script now stores the registration in a host volume (CONFIGURED_ACTIONS_RUNNER_FILES_DIR), disables deregistration on stop, pins the image, sets CPU, memory and PID limits, and sends the token over stdin. Verified: a container restarted with the same settings reconnected without a new token.

Rendering checked locally: substituting the templates yields the expression in all 12 runs-on lines of ci, pr-auto-merge, pr-auto-review, claude-mention and issue-triage.

… setup survives restarts

ci.yml and pr-auto-merge.yml had ubuntu-latest hardcoded and ignored the
config's runner. {{RUNNER}} now renders to a fromJSON(vars.CI_RUNS_ON ...)
expression that falls back to ubuntu-latest, so a repo moves to a
self-hosted pool with one gh variable set and back with one delete.

setup-self-hosted-runner.sh kept the registration inside the container with a
one-hour token, so the runner looped on 'already configured' after its first
restart. Registration now lives in a host volume, with limits and a pinned
image.
@leonardocandiani
leonardocandiani merged commit f1609d2 into main Sep 23, 2026
2 checks passed
@leonardocandiani
leonardocandiani deleted the feat/runner-ci-runs-on branch September 23, 2026 13:36
leonardocandiani added a commit that referenced this pull request Sep 29, 2026
O #14 entrou sem subir a versão, então o plugin instalado seguiu na 2.3.0
antiga e repos novos nasciam com ubuntu-latest fixo no ci.yml.

Autor: Leonardo Candiani
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