From cd2ef81d260ede9e8222cc600d072255f4cf68a0 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Wed, 10 Jun 2020 12:45:15 +0200 Subject: [PATCH] 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 (cherry picked from commit ea97b9f2e829331b0af0a6f0904cba691628c1f5) --- zuul/driver/github/githubconnection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index a054d9e49c..5f7ebccb7b 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -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()