Update access token url

The currently used endpoint
/installations/:installation_id/access_tokens for getting access
tokens is deprecated since a long time and will be removed [1]. Thus
replace it by the current one
/app/installations/:installation_id/access_tokens.

[1] https://developer.github.com/changes/2020-04-15-replacing-create-installation-access-token-endpoint/

Change-Id: I5415472dd68b163d3b980a514b367f0615dbb0bc
This commit is contained in:
Tobias Henkel 2020-06-10 12:45:15 +02:00
parent f6e4d30ea1
commit ea97b9f2e8
1 changed files with 2 additions and 2 deletions

View File

@ -997,8 +997,8 @@ class GithubConnection(BaseConnection):
if ((not expiry) or (not token) or (now >= expiry)):
headers = self._get_app_auth_headers()
url = "%s/installations/%s/access_tokens" % (self.base_url,
installation_id)
url = "%s/app/installations/%s/access_tokens" % (
self.base_url, installation_id)
response = requests.post(url, headers=headers, json=None)
response.raise_for_status()