Skip to content

Commit cef4bb5

Browse files
committed
Fix curl bearer token command
1 parent 64fde3b commit cef4bb5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

next-image-tag-number/action.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ INITIAL_NUMBER=$4
99
TAG_PREFIX=$5
1010

1111
if [ -n "$BEARER_TOKEN" ]; then
12-
AUTH_HEADER="-H \"Authorization: Bearer ${BEARER_TOKEN}\""
12+
TAGS_LIST_JSON=$(curl -fsS -H "Authorization: Bearer ${BEARER_TOKEN}" "${REPOSITORY_API_URL}/${IMAGE_NAME}/tags/list")
1313
else
14-
AUTH_HEADER=""
14+
TAGS_LIST_JSON=$(curl -fsS $AUTH_HEADER "${REPOSITORY_API_URL}/${IMAGE_NAME}/tags/list")
1515
fi
1616

17-
TAGS_LIST_JSON=$(curl -fs $AUTH_HEADER "${REPOSITORY_API_URL}/${IMAGE_NAME}/tags/list")
1817
TAGS=$(echo "$TAGS_LIST_JSON" | jq -r '.tags[]' || echo "")
1918

2019
if [ -z "$TAGS" ]; then

0 commit comments

Comments
 (0)