Skip to content

Commit

Permalink
refresh token for runner removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Headary committed Jan 12, 2025
1 parent 1d3623d commit c31d471
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ services:
replicas: 4
resources:
limits:
cpus: '0.35'
memory: '300M'
cpus: '1.0'
memory: '1G'
8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ ACCESS_TOKEN=$TOKEN

echo "REPO ${REPOSITORY}"

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)
function get_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/runner/actions-runner

REG_TOKEN=$(get_reg_token)
./config.sh --unattended --url "https://github.com/${REPOSITORY}" --token "${REG_TOKEN}"

cleanup() {
echo "Removing runner..."
REG_TOKEN=$(get_reg_token)
./config.sh remove --token "${REG_TOKEN}"
}

Expand Down

0 comments on commit c31d471

Please sign in to comment.