| 1234567891011121314151617181920212223242526 |
- #!/bin/sh
- registration_url="https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPOSITORY}/actions/runners/registration-token"
- echo "Requesting registration URL at '${registration_url}'"
- payload=$(curl -sX POST -H "Authorization: token ${GITHUB_PAT}" ${registration_url})
- export RUNNER_TOKEN=$(echo $payload | jq .token --raw-output)
- ./config.sh \
- --name $(hostname) \
- --token ${RUNNER_TOKEN} \
- --url https://github.com/${GITHUB_OWNER}/${GITHUB_REPOSITORY} \
- --work ${RUNNER_WORKDIR} \
- --unattended \
- --replace \
- --label bullseye
- remove() {
- ./config.sh remove --token "${RUNNER_TOKEN}"
- }
- trap 'remove; exit 130' INT
- trap 'remove; exit 143' TERM
- ./run.sh "$*" &
- wait $!
|