Skip to content

Commit dfdeba3

Browse files
committed
release 1.2.0
* updated the github actions runner version to 2.3.19.1 to support GHE series 3.14 * read env settings in the delete-offline-runners.sh script * added -k to curl commands in delete-offline-runners.sh to workaround ssl wildcard insecure messages * improved VM setup instructions in the readme
1 parent 11c2239 commit dfdeba3

4 files changed

Lines changed: 38 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# GitHub Actions Runner Docker Changelog
22

3+
## 1.2.0
4+
5+
* updated the github actions runner version to 2.3.19.1 to support
6+
GHE series 3.14
7+
* read env settings in the delete-offline-runners.sh script
8+
* added -k to curl commands in delete-offline-runners.sh to
9+
workaround ssl wildcard insecure messages
10+
* improved VM setup instructions in the readme
11+
312
## 1.1.1
413

514
* Added quotes around cpus field in `compose.yml` to fix a docker

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM rockylinux:9.3
22

3-
ARG RUNNER_VERSION="2.314.1"
3+
ARG RUNNER_VERSION="2.319.1"
44

55
# Prevents installdependencies.sh from prompting the user and blocking the image creation
66
RUN useradd -m docker

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,51 @@ self-hosted runner.
2121
## VM setup
2222

2323
1. create a Rocky 9 VM from a VM template
24-
2. install docker and jq:
24+
25+
2. install docker and jq (as root):
2526

2627
```
2728
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
2829
dnf install docker-ce docker-ce-cli containerd.io jq
2930
```
3031

31-
3. create the local user `gherunner`
32-
4. add the `gherunner` user to the `docker` group:
32+
3. create the local user `gherunner` (as root):
3333

3434
```
35-
usermod -G docker gherunner
35+
useradd -m gherunner
3636
```
3737

38-
5. as the `gherunner` user, download the latest release of this repo in
39-
a writable location
40-
6. set the `GITHUB`, `TARGET` and `TOKEN` settings as appropriate in the
41-
`ghe-actions-docker.env` file (further information and examples are
42-
provided in this file).
43-
44-
7. start and enable the docker service:
38+
4. start and enable the docker service (as root):
4539

4640
```
4741
systemctl start docker
4842
systemctl enable docker
4943
```
5044

45+
5. add the `gherunner` user to the `docker` group (as root):
46+
47+
```
48+
usermod -G docker gherunner
49+
```
50+
51+
6. as the `gherunner` user, download the latest release of this repo in
52+
a writable location (i.e. `/home/gherunner`)
53+
54+
7. set the `GITHUB`, `TARGET` and `TOKEN` settings as appropriate in the
55+
`ghe-actions-docker.env` file (further information and examples are
56+
provided in this file).
57+
5158
## Build
5259

53-
To build the container image:
60+
To build the container image (as the `gherunner` user):
5461

5562
```
5663
docker build --tag ghe-actions-runner .
5764
```
5865

5966
## Run
6067

61-
To run the container image:
68+
To run the container image (as the `gherunner` user):
6269

6370
```
6471
docker compose up --scale runner=X -d
@@ -71,8 +78,10 @@ where `X` is the number of runners.
7178

7279
Runners should automatically clean up after themselves once stopped, but if
7380
a SIGKILL occurs, a container may get stuck in the "Offline" state. Should
74-
this happen, run the `./delete-offline-runners.sh` script with the required
75-
arguments.
81+
this happen, run the `./delete-offline-runners.sh` script.
82+
83+
This script reads the `GITHUB`, `TARGET` and `TOKEN` settings from the
84+
`ghe-actions-docker.env` file .
7685

7786
## Useful commands
7887

delete-offline-runners.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/bin/bash
22

3-
GITHUB=$1
4-
TARGET=$2
5-
TOKEN=$3
3+
set -e
64

7-
if [[ "$#" -ne 3 ]]; then
8-
echo "Usage: $0 GITHUB_URL TARGET TOKEN"
9-
exit
10-
fi
5+
source ghe-actions-docker.env
116

127
# test if the target is a repo, prepend /repos for the api
138
curl --fail --silent -k -X GET -H "Authorization: token ${TOKEN}" -H "Accept: application/vnd.github+json" \
@@ -24,7 +19,7 @@ fi
2419

2520
echo "Removing offline GH actions runners on https://${GITHUB}/${TARGET}..."
2621

27-
RUNNER_LIST=$(curl -H "Authorization: token ${TOKEN}" -H "Accept: application/vnd.github+json" \
22+
RUNNER_LIST=$(curl -k -H "Authorization: token ${TOKEN}" -H "Accept: application/vnd.github+json" \
2823
https://api.${GITHUB}/${API_TARGET}/actions/runners \
2924
| jq '[.runners[] | select(.status | contains("offline")) | {id: .id}]')
3025

@@ -34,7 +29,7 @@ for id in $(echo "$RUNNER_LIST" | jq -r '.[] | @base64'); do
3429
echo ${id} | base64 --decode | jq -r ${1}
3530
}
3631
echo "Deleting $(_jq '.id')"
37-
curl -X DELETE -H "Accept: application/vnd.github+json" \
32+
curl -k -X DELETE -H "Accept: application/vnd.github+json" \
3833
-H "Authorization: token ${TOKEN}" \
3934
https://api.${GITHUB}/${API_TARGET}/actions/runners/$(_jq '.id')
4035
done

0 commit comments

Comments
 (0)