diff --git a/docs/automate.md b/docs/automate.md index ef0952439..feecef178 100644 --- a/docs/automate.md +++ b/docs/automate.md @@ -2,9 +2,9 @@ ## Latest Release as Service on Nix VMs -[Run or copy this script for your use](../scripts/latest-svc.sh) to automate configuring a runner as a service on Linux or Mac +[Run or copy this script for your use](../scripts/create-latest-svc.sh) to automate configuring a runner as a service on Linux or Mac -### Step 1: export PAT +### Export PAT Create a GitHub PAT and export it before running the script @@ -12,15 +12,16 @@ Create a GitHub PAT and export it before running the script export RUNNER_CFG_PAT=yourPAT ``` -### Step 2: config one liner +### Ceate service one liner -Repo level one liner; replace yourorg/yourrepo +Repo level one liner; replace with yourorg/yourrepo (repo level) or just yourorg (org level) ```bash -curl https://raw.githubusercontent.com/actions/runner/automate/scripts/latest-svc.sh | bash -s yourorg/yourrepo +curl https://raw.githubusercontent.com/actions/runner/automate/scripts/create-latest-svc.sh | bash -s yourorg/yourrepo ``` -Org level one liner; replace yourorg +### Uninstall service one liner +Repo level one liner; replace with yourorg/yourrepo (repo level) or just yourorg (org level) ```bash -curl https://raw.githubusercontent.com/actions/runner/automate/scripts/latest-svc.sh | bash -s yourorg +curl https://raw.githubusercontent.com/actions/runner/automate/scripts/remove-svc.sh | bash -s yourorg/yourrepo ``` diff --git a/scripts/remove-svc.sh b/scripts/remove-svc.sh index bd8127f10..9770be575 100755 --- a/scripts/remove-svc.sh +++ b/scripts/remove-svc.sh @@ -52,7 +52,8 @@ fi #-------------------------------------- # Get id of runner to remove #-------------------------------------- -runner_id=$(curl -s -X GET ${base_api_url}/${runner_scope}/actions/runners -H "accept: application/vnd.github.everest-preview+json" -H "authorization: token ${RUNNER_CFG_PAT}" | jq -M -j ".runners | .[] | [select(.name == \"${runner_name}\")] | .[0].id") +runner_id=$(curl -s -X GET ${base_api_url}/${runner_scope}/actions/runners -H "accept: application/vnd.github.everest-preview+json" -H "authorization: token ${RUNNER_CFG_PAT}" \ + | jq -M -j ".runners | .[] | [select(.name == \"${runner_name}\")] | .[0].id") if [ -z "${runner_id}" ]; then fatal "Could not find runner with name ${runner_name}"