A Python application to easily manage your GitHub runners from any server or locally.

- Python 3.13+
- Poetry
- Clone:
git clone https://github.com/glefer/github-runner-manager
cd github-runner-manager
cp runners_config.yaml.dist runners_config.yaml
cp .env.example .env
# fill the GITHUB_TOKEN with your API token (see: Configuration (.env and runners_config.yaml) section below)- Install:
poetry install- Help:
poetry run python main.py --helppython main.py build-runners-images # Build Docker runner images
python main.py start-runners # Start Docker runners
python main.py stop-runners # Stop Docker runners
python main.py remove-runners # Remove Docker runners
python main.py check-base-image-update # Check for base image updates
python main.py list-runners # List Docker runnersThe scheduler automates runner actions (checks, builds, etc.) based on flexible planning defined in runners_config.yaml.
It is automatically started in the container via Supervisor. No manual activation/deactivation is required.
For more details, see: docs/scheduler.md
As of September 2025, GitHub runner management uses a GitHub personal token (admin:org, repo scopes) to dynamically generate a registration token.
Minimal .env example:
GITHUB_TOKEN=ghp_................................Security:
- Never share your personal token
- Prefer tokens restricted to org/repo scope
GitHub Runner Manager supports sending notifications via webhooks to keep you informed of important events like runner start/stop, image builds, or available updates.
Example configuration (runners_config.yaml):
webhooks:
enabled: true
timeout: 10
retry_count: 3
retry_delay: 5
# Slack configuration
slack:
enabled: true
webhook_url: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
username: "GitHub Runner Bot"
events:
- runner_started
- runner_error
- build_completed
- update_availableSupported events include:
runner_startedrunner_stoppedrunner_removedrunner_errorrunner_skippedbuild_startedbuild_completedbuild_failedimage_updatedupdate_availableupdate_appliedupdate_error
Supported providers:
- Slack
- Discord
- Microsoft Teams
- Generic webhooks
Testing webhooks:
# Test a specific event
python main.py webhook test --event runner_started --provider slack
# Test all configured events
python main.py webhook test-all --provider slackA sample runners_config.yaml.dist file is provided. Copy it to start your own configuration:
cp runners_config.yaml.dist runners_config.yamlExample runner definition:
runners:
- id: sample
name_prefix: my-runner-sample
labels: [my-runner-set-sample, sample]
nb: 2
build_image: ./config/Dockerfile.sample
techno: php
techno_version: 8.3Simplified example:
runners:
- name: runner-1
image: ghcr.io/actions/runner:latest
labels: [linux, docker]The project includes a config schema (src/services/config_schema.py) validated with Pydantic.
The CLI (powered by Typer) is documented via --help:
poetry run python main.py --helpCommon commands:
list-runners– list runnersstart-runners– start runnersstop-runners– stop runnersremove-runners– remove runnerscheck-base-image-update– check if base images have updates
A Dockerfile is provided for building a custom image.
server→ runs the scheduler via Supervisor<CLI command>→ runs a Python CLI command- No argument → prints help/usage
# Build
docker build -t github-runner-manager .
# Run scheduler
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/runners_config.yaml:/app/runners_config.yaml -v $(pwd)/config:/app/config:ro github-runner-manager server
# Run CLI (example: list runners)
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/runners_config.yaml:/app/runners_config.yaml -v $(pwd)/config:/app/config:ro github-runner-manager list-runners
