rustframe/.github/runner/entrypoint.sh
2025-05-03 22:25:31 +01:00

24 lines
660 B
Bash

#!/bin/bash
REPOSITORY=$REPO
ACCESS_TOKEN=$GH_TOKEN
LABELS=$RUNNER_LABELS
# echo "REPO ${REPOSITORY}"
# echo "ACCESS_TOKEN ${ACCESS_TOKEN}"
REG_TOKEN=$(curl -X POST -H "Authorization: token ${ACCESS_TOKEN}" -H "Accept: application/vnd.github+json" https://api.github.com/repos/${REPOSITORY}/actions/runners/registration-token | jq .token --raw-output)
cd /home/docker/actions-runner
./config.sh --url https://github.com/${REPOSITORY} --token ${REG_TOKEN} --labels ${LABELS}
cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --token ${REG_TOKEN}
}
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
./run.sh & wait $!