Skip to content

Commit

Permalink
fix: pass authentication header only if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Brown authored and janisz committed Feb 22, 2024
1 parent bc9b408 commit a6321c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ runs:
# in order to increase the limit of 60 requests per hour per IP address to a higher value that's also counted
# per GitHub account.
# Caching is disabled in order not to receive stale responses from Varnish cache fronting GitHub API.
RELEASE_HEADER=''
if [ ! -z "${{github.token}}" ]; then
RELEASE_HEADER="--header 'authorization: Bearer ${{ github.token }}'"
fi
RELEASE_INFO="$(curl --silent --show-error --fail \
--header 'authorization: Bearer ${{ github.token }}' \
--header 'Cache-Control: no-cache, must-revalidate' \
${RELEASE_HEADER} \
"${RELEASE_URL}")"
RELEASE_NAME="$(echo "${RELEASE_INFO}" | jq --raw-output ".name")"
LOCATION="$(echo "${RELEASE_INFO}" \
Expand Down

0 comments on commit a6321c1

Please sign in to comment.