gm3dmo/the-power

Use the word `Bearer` in the auth_header to replace the word token

gm3dmo opened this issue · 2 comments

Getting started with the Rest API

curl --request GET \
--url "https://api.github.com/octocat" \
--header "Authorization: Bearer YOUR-TOKEN"

This is defined in configure.py:

auth_header="Authorization: token ${token}"

Replace token with Bearer

Something like this:

diff --git a/list-repo.sh b/list-repo.sh
index 4f9f8ca..bd5090a 100755
--- a/list-repo.sh
+++ b/list-repo.sh
@@ -25,7 +25,7 @@ if [ $preferred_client == "gh" ]; then
 else
     curl ${curl_custom_flags} \
          -H "Accept: application/vnd.github.v3+json" \
-         -H "Authorization: token ${GITHUB_TOKEN}" \
+         -H "${auth_header}" \
             ${GITHUB_API_BASE_URL}/repos/${owner}/${repo}
 fi