From b051990315bee41283cebaee1dd03bc5e954869f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Toulet?= <35176601+AgnesToulet@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:25:43 +0200 Subject: [PATCH] Update get_gh_token.sh --- scripts/get_gh_token.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/get_gh_token.sh b/scripts/get_gh_token.sh index cf88b81..fd5be14 100644 --- a/scripts/get_gh_token.sh +++ b/scripts/get_gh_token.sh @@ -4,11 +4,14 @@ set -e # Ensure necessary tools are installed apk add --no-cache openssl curl jq +echo "tools installed" # Write the private key to a file echo "$GITHUB_APP_PRIVATE_KEY" > private-key.pem chmod 600 private-key.pem +echo "private key in file" + # Generate the JWT NOW=$(date +%s) EXPIRATION=$(($NOW + 600)) @@ -24,6 +27,8 @@ RESPONSE=$(curl -s -X POST \ -H "Accept: application/vnd.github+json" \ https://api.github.com/app/installations/$GITHUB_INSTALLATION_ID/access_tokens) +echo "get access token" + # Extract the token from the response GITHUB_TOKEN=$(echo $RESPONSE | jq -r '.token')