From 6cbd7594c3d54f6ee4f70433dbb4d88020e2bc52 Mon Sep 17 00:00:00 2001 From: Joren-vanGoethem Date: Thu, 24 Oct 2024 17:44:43 +0200 Subject: [PATCH] add start file --- github-actions-runner/start.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 github-actions-runner/start.sh diff --git a/github-actions-runner/start.sh b/github-actions-runner/start.sh new file mode 100644 index 0000000..1667f72 --- /dev/null +++ b/github-actions-runner/start.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +REPO=$REPO +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/${REPO}/actions/runners/registration-token | jq .token --raw-output) + +cd /home/docker/actions-runner + +./config.sh --url https://github.com/${REPO} --token ${REG_TOKEN} + +cleanup() { + echo "Removing runner..." + ./config.sh remove --unattended --token ${REG_TOKEN} +} + +trap 'cleanup; exit 130' INT +trap 'cleanup; exit 143' TERM + +./run.sh & wait $! \ No newline at end of file