]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - build-scripts/changelog-from-pr.py
Merge pull request #8910 from omoerbeek/rec-routing-tag
[thirdparty/pdns.git] / build-scripts / changelog-from-pr.py
index 981f646bc0c2e2fc20ed1ce71c91967e4daf1491..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,13 +70,14 @@ 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:
             print(e)
             sys.exit(1)
-        if 'name'in user_info:
+        if 'name' in user_info:
             out += ' ({})'.format(user_info['name'])
         else:
             out += ' (@{})'.format(user_info['login'])