Skip to content

Commit 2e70bba

Browse files
committed
Use GITHUB_TOKEN in Github API requests.
1 parent 9fd2c69 commit 2e70bba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: release/0-get-latest-dependencies-versions.sh

+6
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,17 @@ retrieveLatestVersion() {
4444
LATEST_VERSION_EXTRACTOR="tail"
4545
fi
4646

47+
AUTH_ARG=""
48+
if [[ -v GITHUB_TOKEN ]]; then
49+
AUTH_ARG="-H 'Authorization: Bearer $GITHUB_TOKEN'"
50+
fi
51+
4752
GITHUB_RESPONSE="$(curl -s \
4853
-D "$HEADERS_FILE" \
4954
--etag-save "$ETAG_FILE" \
5055
-H "If-None-Match: $ETAG" \
5156
-H "Accept: application/vnd.github.v3+json" \
57+
$AUTH_ARG \
5258
"https://api.github.com/repos/$REPO/$ENDPOINT")"
5359

5460
STATUS_CODE_LINE="$(cat "$HEADERS_FILE" | head -n 1)"

0 commit comments

Comments
 (0)