Skip to content

Commit f8ce1aa

Browse files
committed
Stop using query parameters for authentication on GitHub
Instead use an HTTP 'Authorization' header
1 parent 5eca4c9 commit f8ce1aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ fi
465465
#
466466

467467
# check if release already exists
468-
response=$(curl -s -S -X GET "$API_URL/tags/$TAG?access_token=$TOKEN")
468+
response=$(curl -s -S -X GET "$API_URL/tags/$TAG" -H "Authorization: token $TOKEN")
469469
MESSAGE=$(json_get_key message)
470470
RELEASE_ID=$(json_get_key id)
471471

@@ -475,7 +475,7 @@ elif [ x"$RELEASE_ID" != x ] ; then
475475
# release already exists -> error out or delete it
476476
if [ "x$FORCE" = xyes ] ; then
477477
notice "Deleting existing release $TAG from GitHub"
478-
response=$(curl --fail -s -S -X DELETE "$API_URL/$RELEASE_ID?access_token=$TOKEN")
478+
response=$(curl --fail -s -S -X DELETE "$API_URL/$RELEASE_ID" -H "Authorization: token $TOKEN")
479479
MESSAGE=
480480
else
481481
error "release $TAG already exists on GitHub, aborting (use --force to override this)"
@@ -500,7 +500,7 @@ EOF
500500

501501
notice "Creating new release $TAG on GitHub"
502502
response=$(curl -s -S -H "Content-Type: application/json" \
503-
-X POST --data "$DATA" "$API_URL?access_token=$TOKEN")
503+
-X POST --data "$DATA" "$API_URL" -H "Authorization: token $TOKEN")
504504

505505
MESSAGE=$(json_get_key message)
506506
if [ x"$MESSAGE" != x ] ; then

0 commit comments

Comments
 (0)