Skip to content

Commit 443b739

Browse files
novalutcardonne
authored andcommitted
Add support for defining runner labels. Update README.md.
1 parent 8dfa87e commit 443b739

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ The following environment variables allows you to control the configuration para
7575
| RUNNER_TOKEN | Runner token provided by GitHub in the Actions page. These tokens are valid for a short period. | Required if `GITHUB_ACCESS_TOKEN` is not provided
7676
| RUNNER_WORK_DIRECTORY | Runner's work directory | `"_work"`
7777
| RUNNER_NAME | Name of the runner displayed in the GitHub UI | Hostname of the container
78+
| RUNNER_LABELS | Extra labels in addition to the default: 'self-hosted,Linux,X64' (based on your OS and architecture) | `""`
7879
| RUNNER_REPLACE_EXISTING | `"true"` will replace existing runner with the same name, `"false"` will use a random name if there is conflict | `"true"`
7980
8081
## Runner Token

debian-buster/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV RUNNER_NAME=""
88
ENV RUNNER_WORK_DIRECTORY="_work"
99
ENV RUNNER_TOKEN=""
1010
ENV RUNNER_REPOSITORY_URL=""
11+
ENV RUNNER_LABELS=""
1112
ENV RUNNER_ALLOW_RUNASROOT=true
1213
ENV GITHUB_ACCESS_TOKEN=""
1314

debian-buster/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ if [ "$(echo $RUNNER_REPLACE_EXISTING | tr '[:upper:]' '[:lower:]')" == "true" ]
3333
CONFIG_OPTS="--replace"
3434
fi
3535

36+
if [[ -n $RUNNER_LABELS ]]; then
37+
CONFIG_OPTS="${CONFIG_OPTS} --labels ${RUNNER_LABELS}"
38+
fi
39+
3640
if [[ -f ".runner" ]]; then
3741
echo "Runner already configured. Skipping config."
3842
else

0 commit comments

Comments
 (0)