Skip to content

Commit

Permalink
Fix basic auth to the supported Bearer authentication
Browse files Browse the repository at this point in the history
Authenticate to GitHub API using the supported Bearer
  • Loading branch information
wechuli authored Nov 13, 2023
1 parent e2a11e9 commit cb09a32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -89,6 +91,7 @@ def _request(*args, **kwargs):
return response



def handle_http_error(func):
@wraps(func)
def with_error_handling(*args, **kwargs):
Expand Down

0 comments on commit cb09a32

Please sign in to comment.