This is a deterministic & scheduled bot for Automa to migrate GitHub Actions workflow runner labels.
- Automatically replaces
runs-on
fields in your GitHub Actions workflows with configured custom runner labels. - Supports updating runners in
matrix
strategies and reusable workflows inputs. - Ignores non-exact matches and group labels to avoid unintended changes.
- Configurable via the
UPDATE_MAP
environment variable.
Since this bot can be further configured, there is no single version of this to be installed on Automa Cloud.
This bot can be self-hosted. You can follow these steps to get it running.
Register a bot of scheduled type on Automa (Cloud or Self-hosted) and point its webhook to your planned server (e.g., http://your-server-ip:8000/hooks/automa
). Copy the webhook secret after it is created.
# Setup environment variables
export NODE_ENV=production
export AUTOMA_WEBHOOK_SECRET=your_secret_here
# Configure bot
export UPDATE_MAP='{"ubuntu-24.04":"blacksmith-4vcpu-ubuntu-2204"}'
# Install dependencies & build
npm install
npm run build
# Start server
node build/index.js
-
Configuration: The bot reads its configuration from the
UPDATE_MAP
environment variable. This variable should be a JSON string that maps old runner labels to their new counterparts. For example:{"ubuntu-24.04":"blacksmith-4vcpu-ubuntu-2204"}
. -
Update Logic: For each workflow file in
.github/workflows
, the bot reads the content and uses a regular expression to find and replace the runner labels. The key aspects of the update logic are:- It replaces all occurrences of the old runner label with the new one.
- It automatically handles GitHub's default
*-latest
runners, updating them if a replacement for the corresponding versioned runner is defined in the configuration. - It correctly handles runners defined directly in
runs-on
and those within amatrix
strategy. - It avoids making changes to runner groups by ignoring labels inside a
group:
key. - It performs an exact match to prevent accidentally updating partial labels.
Contributions and feedback are welcome! Feel free to open an issue or submit a pull request. See CONTRIBUTING.md for more details. Here is a list of Contributors.
MIT
Report here.