Skip to content

Commit 1047659

Browse files
authored
Merge pull request #54 from Tecnativa/fix-gh-api-auth
Migrate Github API authentication to new spec
2 parents 2f7895f + 98aeeb8 commit 1047659

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.rst

+5
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ To work around API limitation, you must first generate a
221221
Changes
222222
=======
223223

224+
2.1 (August 26, 2021)
225+
---------------------
226+
227+
* Migrate Github API authentication to new spec (https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/)
228+
224229
2.0 (August 17, 2021)
225230
---------------------
226231

git_aggregator/repo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ def _set_remote(self, name, url):
314314
def _github_api_get(self, path):
315315
url = 'https://api.github.com' + path
316316
token = os.environ.get('GITHUB_TOKEN')
317+
headers = None
317318
if token:
318-
url += '?access_token=' + token
319-
return requests.get(url)
319+
headers = {'Authorization': 'token %s' % token}
320+
return requests.get(url, headers=headers)
320321

321322
def collect_prs_info(self):
322323
"""Collect all pending merge PRs info.

0 commit comments

Comments
 (0)