Skip to content

Commit fbe6971

Browse files
updating logic for token
1 parent 48d733f commit fbe6971

File tree

1 file changed

+20
-20
lines changed
  • .github/scripts/ppc64le/self-hosted-builder/helpers

1 file changed

+20
-20
lines changed

.github/scripts/ppc64le/self-hosted-builder/helpers/app_token.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@ echo "INSTALL_ID: $INSTALL_ID"
1919
echo "APP_PRIVATE_KEY path: $APP_PRIVATE_KEY"
2020

2121
# Generate JWT
22-
header='{"alg":"RS256","typ":"JWT"}'
23-
payload="{\"iat\":$(date +%s),\"exp\":$(( $(date +%s) + 600 )),\"iss\":${APP_ID}}"
22+
# header='{"alg":"RS256","typ":"JWT"}'
23+
# payload="{\"iat\":$(date +%s),\"exp\":$(( $(date +%s) + 600 )),\"iss\":${APP_ID}}"
2424

25-
header_base64=$(echo -n "$header" | openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
26-
payload_base64=$(echo -n "$payload" | openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
25+
# header_base64=$(echo -n "$header" | openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
26+
# payload_base64=$(echo -n "$payload" | openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
2727

28-
signature=$(echo -n "${header_base64}.${payload_base64}" | \
29-
openssl dgst -sha256 -sign "${APP_PRIVATE_KEY}" | \
30-
openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
28+
# signature=$(echo -n "${header_base64}.${payload_base64}" | \
29+
# openssl dgst -sha256 -sign "${APP_PRIVATE_KEY}" | \
30+
# openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
3131

32-
echo "Contents of APP_PRIVATE_KEY:"
33-
cat "$APP_PRIVATE_KEY"
32+
# echo "Contents of APP_PRIVATE_KEY:"
33+
# cat "$APP_PRIVATE_KEY"
3434

3535

36-
generated_jwt="${header_base64}.${payload_base64}.${signature}"
36+
# generated_jwt="${header_base64}.${payload_base64}.${signature}"
3737

38-
echo $generated_jwt
39-
API_VERSION=v3
40-
API_HEADER="Accept: application/vnd.github+json"
38+
# echo $generated_jwt
39+
# API_VERSION=v3
40+
# API_HEADER="Accept: application/vnd.github+json"
4141

42-
auth_header="Authorization: Bearer ${generated_jwt}"
42+
# auth_header="Authorization: Bearer ${generated_jwt}"
4343

44-
app_installations_response=$(curl -sX POST \
45-
-H "${auth_header}" \
46-
-H "${API_HEADER}" \
47-
--url "https://api.github.com/app/installations/${INSTALL_ID}/access_tokens" \
48-
)
44+
# app_installations_response=$(curl -sX POST \
45+
# -H "${auth_header}" \
46+
# -H "${API_HEADER}" \
47+
# --url "https://api.github.com/app/installations/${INSTALL_ID}/access_tokens" \
48+
# )
4949

50-
echo "$app_installations_response" | jq --raw-output '.token'
50+
# echo "$app_installations_response" | jq --raw-output '.token'
5151

5252
#echo "ACCESS_TOKEN=${jwt}" > "${DST_FILE}"

0 commit comments

Comments
 (0)