From: Otto Moerbeek Date: Mon, 20 Apr 2020 11:07:29 +0000 (+0200) Subject: Do not use github deprecated API for changelog script X-Git-Tag: rec-4.4.0-alpha1~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7789db70fa3fdc0034cd1c8d0f440120b612926c;p=thirdparty%2Fpdns.git Do not use github deprecated API for changelog script See https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ --- 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: