]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do not use github deprecated API for changelog script 9043/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Apr 2020 11:07:29 +0000 (13:07 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Apr 2020 11:07:29 +0000 (13:07 +0200)
See https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/

build-scripts/changelog-from-pr.py

index e4cc4095a2e0d620afdb7787d01c8af1e484e0fa..174c0fa686848a58269883f113efdca55ac55dc5 100755 (executable)
@@ -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: