Skip to content

Commit

Permalink
Use GITHUB_TOKEN in Github API requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
GollyTicker committed May 25, 2024
1 parent 9fd2c69 commit 2e70bba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions release/0-get-latest-dependencies-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ retrieveLatestVersion() {
LATEST_VERSION_EXTRACTOR="tail"
fi

AUTH_ARG=""
if [[ -v GITHUB_TOKEN ]]; then
AUTH_ARG="-H 'Authorization: Bearer $GITHUB_TOKEN'"
fi

GITHUB_RESPONSE="$(curl -s \
-D "$HEADERS_FILE" \
--etag-save "$ETAG_FILE" \
-H "If-None-Match: $ETAG" \
-H "Accept: application/vnd.github.v3+json" \
$AUTH_ARG \
"https://api.github.com/repos/$REPO/$ENDPOINT")"

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

0 comments on commit 2e70bba

Please sign in to comment.