Skip to content

Commit

Permalink
Merge pull request #54 from Tecnativa/fix-gh-api-auth
Browse files Browse the repository at this point in the history
Migrate Github API authentication to new spec
  • Loading branch information
sbidoul authored Aug 26, 2021
2 parents 2f7895f + 98aeeb8 commit 1047659
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ To work around API limitation, you must first generate a
Changes
=======

2.1 (August 26, 2021)
---------------------

* Migrate Github API authentication to new spec (https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/)

2.0 (August 17, 2021)
---------------------

Expand Down
5 changes: 3 additions & 2 deletions git_aggregator/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,10 @@ def _set_remote(self, name, url):
def _github_api_get(self, path):
url = 'https://api.github.com' + path
token = os.environ.get('GITHUB_TOKEN')
headers = None
if token:
url += '?access_token=' + token
return requests.get(url)
headers = {'Authorization': 'token %s' % token}
return requests.get(url, headers=headers)

def collect_prs_info(self):
"""Collect all pending merge PRs info.
Expand Down

0 comments on commit 1047659

Please sign in to comment.