From 0a6e708a9421842a8728552d373b31296cd896c5 Mon Sep 17 00:00:00 2001 From: Wechuli Date: Mon, 13 Nov 2023 14:18:31 +0300 Subject: [PATCH] Fix basic auth to the supported Bearer authentication Authenticate to GitHub API using the supported Bearer --- github_release.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github_release.py b/github_release.py index d86331d..5658dc3 100755 --- a/github_release.py +++ b/github_release.py @@ -76,7 +76,9 @@ def _request(*args, **kwargs): if not token: token = os.environ.get("GITHUB_TOKEN", None) if token and with_auth: - kwargs["auth"] = (token, 'x-oauth-basic') + # Using Bearer token authentication instead of Basic Authentication + kwargs['headers'] = kwargs.get('headers', {}) + kwargs['headers']['Authorization'] = 'Bearer ' + token for _ in range(3): response = request(*args, **kwargs) is_travis = os.getenv("TRAVIS", None) is not None