Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.79 KB

automate.md

File metadata and controls

57 lines (38 loc) · 1.79 KB

Automate Configuring Self-Hosted Runners

Export PAT

Before running any of these sample scripts, create a GitHub PAT and export it before running the script

export RUNNER_CFG_PAT=yourPAT

Create running as a service

Scenario: Run on a machine or VM (not container) which automates:

  • Resolving latest released runner
  • Download and extract latest
  • Acquire a registration token
  • Configure the runner
  • Run as a systemd (linux) or Launchd (osx) service

👉 Sample script here 👈

Run as a one-liner. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level)

curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/create-latest-svc.sh | bash -s yourorg/yourrepo

Uninstall running as service

Scenario: Run on a machine or VM (not container) which automates:

  • Stops and uninstalls the systemd (linux) or Launchd (osx) service
  • Acquires a removal token
  • Removes the runner

👉 Sample script here 👈

Repo level one liner. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level)

curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/remove-svc.sh | bash -s yourorg/yourrepo

Delete an offline runner

Scenario: Deletes a registered runner that is offline:

  • Ensures the runner is offline
  • Resolves id from name
  • Deletes the runner

👉 Sample script here 👈

Repo level one-liner. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level) and replace runnername

curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/delete.sh | bash -s yourorg/yourrepo runnername