From 7789db70fa3fdc0034cd1c8d0f440120b612926c Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 20 Apr 2020 13:07:29 +0200 Subject: [PATCH] Do not use github deprecated API for changelog script See https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ --- build-scripts/changelog-from-pr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build-scripts/changelog-from-pr.py b/build-scripts/changelog-from-pr.py index e4cc4095a2..174c0fa686 100755 --- a/build-scripts/changelog-from-pr.py +++ b/build-scripts/changelog-from-pr.py @@ -35,7 +35,8 @@ for pr in arguments.pullrequest: try: if access_token: res = requests.get('https://api.github.com/repos/PowerDNS/pdns/pulls/' - '{}?access_token={}'.format(pr, access_token)) + '{}'.format(pr), + headers={'Authorization': 'token ' + access_token}) else: res = requests.get('https://api.github.com/repos/PowerDNS/pdns/pulls/' '{}'.format(pr), auth=httpAuth) @@ -69,7 +70,8 @@ for pr in arguments.pullrequest: 'omoerbeek']: try: if access_token: - user_info = requests.get(pr_info['user']['url'] + '?access_token=' + access_token, auth=httpAuth).json() + user_info = requests.get(pr_info['user']['url'], + headers={'Authorization': 'token ' + access_token}).json() else: user_info = requests.get(pr_info['user']['url'], auth=httpAuth).json() except (requests.exceptions.HTTPError, ValueError) as e: -- 2.47.2