Skip to content

Commit 59f119b

Browse files
committed
Checking token format
1 parent a112df9 commit 59f119b

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

scripts/fetch_and_build_deb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ if [ -z "${pkglatest}" ]; then
8888
exit $noinput
8989
fi
9090

91-
echo "header=\"Authorization: Bearer ${GITHUB_TOKEN}\"" > ~/.curlrc
91+
if [[ "$GITHUB_TOKEN" == ..* ]]; then
92+
echo "TOKEN FORMAT: appears to be a JWT (app-level token)."
93+
else
94+
echo "TOKEN FORMAT: not a JWT (installation token or PAT)."
95+
fi
96+
97+
98+
echo "header=\"Authorization: token ${GITHUB_TOKEN}\"" > ~/.curlrc
9299
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
93100

94101
export NAME

scripts/fetch_and_build_pgxn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if [ -z "${pkglatest}" ]; then
5050
exit $noinput
5151
fi
5252

53-
echo "header=\"Authorization: Bearer ${GITHUB_TOKEN}\"" > ~/.curlrc
53+
echo "header=\"Authorization: token ${GITHUB_TOKEN}\"" > ~/.curlrc
5454
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
5555

5656
cp -R /buildfiles/META.json "${builddir}"

scripts/fetch_and_build_rpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if [ -z "${pkglatest}" ]; then
8181
exit $noinput
8282
fi
8383

84-
echo "header=\"Authorization: Bearer ${GITHUB_TOKEN}\"" > ~/.curlrc
84+
echo "header=\"Authorization: token ${GITHUB_TOKEN}\"" > ~/.curlrc
8585
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
8686

8787
name=$(determine_name)

0 commit comments

Comments
 (0)