File tree Expand file tree Collapse file tree 2 files changed +0
-24
lines changed
.github/scripts/ppc64le/self-hosted-builder/helpers Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,6 @@ set -o pipefail
1313
1414set -e # Exit on error
1515
16- echo " Inside app_token.sh:"
17-
18- if [[ -z " $APP_ID " || -z " $INSTALL_ID " || -z " $APP_PRIVATE_KEY " ]]; then
19- echo " Missing required environment variables!" >&2
20- exit 1
21- fi
22-
23- # APP_ID=$(cat $1) # Path to appid.env
24- # INSTALL_ID=$(cat $2)
25- # APP_PRIVATE_KEY=$3 # Path to key_private.pem
26- echo " APP_ID: $APP_ID "
27- echo " INSTALL_ID: $INSTALL_ID "
28- echo " APP_PRIVATE_KEY path: $APP_PRIVATE_KEY "
29-
3016# Generate JWT
3117header=' {"alg":"RS256","typ":"JWT"}'
3218payload=" {\" iat\" :$( date +%s) ,\" exp\" :$(( $(date +% s) + 600 )) ,\" iss\" :${APP_ID} }"
@@ -38,10 +24,6 @@ signature=$(echo -n "${header_base64}.${payload_base64}" | \
3824 openssl dgst -sha256 -sign " ${APP_PRIVATE_KEY} " | \
3925 openssl base64 | tr -d ' =' | tr ' /+' ' _-' | tr -d ' \n' )
4026
41- echo " Contents of APP_PRIVATE_KEY:"
42- cat " $APP_PRIVATE_KEY "
43-
44-
4527generated_jwt=" ${header_base64} .${payload_base64} .${signature} "
4628
4729echo $generated_jwt
@@ -57,5 +39,3 @@ app_installations_response=$(curl -sX POST \
5739 )
5840
5941echo " $app_installations_response " | jq --raw-output ' .token'
60-
61- # echo "ACCESS_TOKEN=${jwt}" > "${DST_FILE}"
Original file line number Diff line number Diff line change @@ -6,9 +6,5 @@ INSTALL_ID=$2
66APP_PRIVATE_KEY=$3
77DST_FILE=" $4 "
88
9- # echo "APP_ID file content: $(<"${APP_ID}")"
10- # echo "INSTALL_ID file content: $(<"${INSTALL_ID}")"
11- # echo "APP_PRIVATE_KEY file content: $(<"${APP_PRIVATE_KEY}")"
12-
139ACCESS_TOKEN=" $( APP_ID=" $( < " ${APP_ID} " ) " INSTALL_ID=" $( < " ${INSTALL_ID} " ) " APP_PRIVATE_KEY=" ${APP_PRIVATE_KEY} " " ${SCRIPT_DIR} /app_token.sh" ) "
1410echo " ACCESS_TOKEN=${ACCESS_TOKEN} " > " ${DST_FILE} "
You can’t perform that action at this time.
0 commit comments