File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,16 @@ jobs:
5252
5353 APP_ID=${{ env.GH_APP_ID }}
5454
55- # Generate JWT
56- JWT=$(python3 - <<EOF
57- import jwt, time
58- private_key = open("private-key.pem", "r").read()
59- payload = {
60- "iat": int(time.time()),
61- "exp": int(time.time()) + 600, # 10-minute expiration
62- "iss": $APP_ID
63- }
64- print(jwt.encode(payload, private_key, algorithm="RS256"))
65- EOF
66- )
6755
56+ # Get Installation ID
57+ INSTALLATION_ID=$(curl -s -X GET -H "Authorization: Bearer $JWT" \
58+ -H "Accept: application/vnd.github.v3+json" \
59+ https://api.github.com/app/installations | jq -r '.[0].id')
6860
61+ # Request Installation Access Token
62+ ACCESS_TOKEN=$(curl -s -X POST -H "Authorization: Bearer $JWT" \
63+ -H "Accept: application/vnd.github.v3+json" \
64+ https://api.github.com/app/installations/$INSTALLATION_ID/access_tokens | jq -r '.token')
6965
7066 echo "ACCESS_TOKEN=$ACCESS_TOKEN" >> "$GITHUB_ENV"
7167
You can’t perform that action at this time.
0 commit comments