Skip to content

Commit

Permalink
Merge pull request SanderKnape#5 from idealo/remove-token
Browse files Browse the repository at this point in the history
Request a new token when remove a self-hosted runner
  • Loading branch information
SanderKnape authored Aug 10, 2020
2 parents 7cd6e65 + 92dc94b commit a7d0cde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export RUNNER_TOKEN=$(echo $payload | jq .token --raw-output)
--replace

remove() {
./config.sh remove --unattended --token "${RUNNER_TOKEN}"
payload=$(curl -sX POST -H "Authorization: token ${GITHUB_PAT}" ${token_url%/registration-token}/remove-token)
export REMOVE_TOKEN=$(echo $payload | jq .token --raw-output)

./config.sh remove --unattended --token "${REMOVE_TOKEN}"
}

trap 'remove; exit 130' INT
Expand Down

0 comments on commit a7d0cde

Please sign in to comment.