This commit is contained in:
Bryan MacFarlane
2020-04-15 11:45:17 -04:00
parent 1410fe000e
commit de317dba60
2 changed files with 10 additions and 8 deletions

View File

@@ -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
```

View File

@@ -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}"