2023-11-08 16:31:37 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-11-09 10:45:18 -06:00
|
|
|
OWNER=$OWNER
|
|
|
|
REPO=$REPO
|
2023-11-08 16:31:37 -06:00
|
|
|
ACCESS_TOKEN=$ACCESS_TOKEN
|
|
|
|
|
2023-11-09 10:45:18 -06:00
|
|
|
REG_TOKEN=$(curl -sX POST -H "Authorization: token ${ACCESS_TOKEN}" https://api.github.com/repos/${OWNER}/${REPO}/actions/runners/registration-token | jq .token --raw-output)
|
2023-11-08 16:31:37 -06:00
|
|
|
|
|
|
|
cd /home/docker/actions-runner
|
|
|
|
|
2023-11-09 10:45:18 -06:00
|
|
|
./config.sh --url https://github.com/${OWNER}/${REPO} --token ${REG_TOKEN}
|
2023-11-08 16:31:37 -06:00
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
echo "Removing runner..."
|
|
|
|
./config.sh remove --unattended --token ${REG_TOKEN}
|
|
|
|
}
|
|
|
|
|
|
|
|
trap 'cleanup; exit 130' INT
|
|
|
|
trap 'cleanup; exit 143' TERM
|
|
|
|
|
|
|
|
./run.sh & wait $!
|