File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
.github/scripts/ppc64le/self-hosted-builder Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ StartLimitIntervalSec=0
77Type =simple
88Restart =always
99ExecStartPre =-/usr/bin/docker rm --force actions-runner.%i
10- ExecStartPre =-/usr/local/bin/app_token .sh /etc/actions-runner/%i/appid.env /etc/actions-runner/%i/key_private.pem /etc/actions-runner/%i/ghtoken.env
10+ 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
1111ExecStart =/usr/bin/docker run \
1212 --env-file =/etc/actions-runner/%i/env \
1313 --env-file =/etc/actions-runner/%i/ghtoken.env \
Original file line number Diff line number Diff line change @@ -25,5 +25,19 @@ signature=$(echo -n "${header_base64}.${payload_base64}" | \
2525 openssl dgst -sha256 -sign " $PRIVATE_KEY_PATH " | \
2626 openssl base64 | tr -d ' =' | tr ' /+' ' _-' | tr -d ' \n' )
2727
28- jwt=" ${header_base64} .${payload_base64} .${signature} "
29- echo " ACCESS_TOKEN=${jwt} " > " ${DST_FILE} "
28+ generated_jwt=" ${header_base64} .${payload_base64} .${signature} "
29+
30+ API_VERSION=v3
31+ API_HEADER=" Accept: application/vnd.github+json"
32+
33+ auth_header=" Authorization: Bearer ${generated_jwt} "
34+
35+ app_installations_response=$( curl -sX POST \
36+ -H " ${auth_header} " \
37+ -H " ${API_HEADER} " \
38+ --url " https://api.github.com/app/installations/${INSTALL_ID} /access_tokens" \
39+ )
40+
41+ echo " $app_installations_response " | jq --raw-output ' .token'
42+
43+ # echo "ACCESS_TOKEN=${jwt}" > "${DST_FILE}"
You can’t perform that action at this time.
0 commit comments