Skip to content

Commit 642efe3

Browse files
set the work dir
1 parent 91a0400 commit 642efe3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/scripts/ppc64le/self-hosted-builder/[email protected]

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ StartLimitIntervalSec=0
77
[Service]
88
Type=simple
99
Restart=always
10+
11+
# Cleanup stale containers
12+
ExecStartPre=-/usr/bin/docker rm --force actions-runner.%i || true
13+
1014
ExecStartPre=-/usr/bin/docker rm --force actions-runner.%i
1115
ExecStartPre=-/usr/local/bin/gh_token_generator.sh /etc/actions-runner/%i/appid.env /etc/actions-runner/%i/installid.env /etc/actions-runner/%i/key_private.pem /etc/actions-runner/%i/ghtoken.env
1216
ExecStartPre=-/usr/local/bin/gh_cat_token.sh /etc/actions-runner/%i/ghtoken.env /etc/actions-runner/%i/ghtoken.txt
@@ -28,6 +32,8 @@ ExecStop=/bin/sh -c "docker exec actions-runner.%i kill -INT -- -1"
2832
ExecStop=/bin/sh -c "docker wait actions-runner.%i"
2933
ExecStop=/bin/sh -c "docker rm actions-runner.%i"
3034

35+
ExecStop=/usr/bin/env rm -f /etc/actions-runner/%i/ghtoken.env /etc/actions-runner/%i/ghtoken.txt
36+
3137
# Logging and Permissions
3238
StandardOutput=journal
3339
StandardError=journal

.github/scripts/ppc64le/self-hosted-builder/fs/usr/bin/actions-runner

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,12 @@ rm -f "$token_file"
4949

5050
# Run one job.
5151
./run.sh
52+
53+
# Unregister runner after completion
54+
ACCESS_TOKEN="$(cat /run/runner_secret)"
55+
curl \
56+
-X DELETE \
57+
-H "Accept: application/vnd.github.v3+json" \
58+
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
59+
"https://api.github.com/repos/${OWNER}/${REPO}/actions/runners/$(jq --raw-output .id <runner-id.json)"
60+
unset ACCESS_TOKEN

0 commit comments

Comments
 (0)