Skip to content

Commit 74706a7

Browse files
updating logic for token
1 parent fbe6971 commit 74706a7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
set -o pipefail
1313

14+
set -e # Exit on error
15+
16+
if [[ -z "$APP_ID" || -z "$INSTALL_ID" || -z "$APP_PRIVATE_KEY" ]]; then
17+
echo "Missing required environment variables!" >&2
18+
exit 1
19+
fi
20+
1421
#APP_ID=$(cat $1) # Path to appid.env
1522
#INSTALL_ID=$(cat $2)
1623
#APP_PRIVATE_KEY=$3 # Path to key_private.pem

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ INSTALL_ID=$2
66
APP_PRIVATE_KEY=$3
77
DST_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+
913
ACCESS_TOKEN="$(APP_ID="$(<"${APP_ID}")" INSTALL_ID="$(<"${INSTALL_ID}")" APP_PRIVATE_KEY="$(<"${APP_PRIVATE_KEY}")" "${SCRIPT_DIR}/app_token.sh")"
1014
echo "ACCESS_TOKEN=${ACCESS_TOKEN}" > "${DST_FILE}"

0 commit comments

Comments
 (0)