entrypoint.sh 710 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. registration_url="https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPOSITORY}/actions/runners/registration-token"
  3. echo "Requesting registration URL at '${registration_url}'"
  4. payload=$(curl -sX POST -H "Authorization: token ${GITHUB_PAT}" ${registration_url})
  5. export RUNNER_TOKEN=$(echo $payload | jq .token --raw-output)
  6. ./config.sh \
  7. --name $(hostname) \
  8. --token ${RUNNER_TOKEN} \
  9. --url https://github.com/${GITHUB_OWNER}/${GITHUB_REPOSITORY} \
  10. --work ${RUNNER_WORKDIR} \
  11. --unattended \
  12. --replace \
  13. --label bullseye
  14. remove() {
  15. ./config.sh remove --token "${RUNNER_TOKEN}"
  16. }
  17. trap 'remove; exit 130' INT
  18. trap 'remove; exit 143' TERM
  19. ./run.sh "$*" &
  20. wait $!