From c19e77a06c8e37519844890217e134b6eb09d27f Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 1 Feb 2024 00:49:30 +0100 Subject: [PATCH] fix(app): pre-bind log This is necessary with probot@13, see https://github.com/probot/probot/pull/1874#issuecomment-1837779069. --- packages/app/lib/apps/github-client/GithubClient.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/app/lib/apps/github-client/GithubClient.js b/packages/app/lib/apps/github-client/GithubClient.js index 7402951d..b49b63be 100644 --- a/packages/app/lib/apps/github-client/GithubClient.js +++ b/packages/app/lib/apps/github-client/GithubClient.js @@ -98,9 +98,20 @@ function GitHubClient(app, webhookEvents, logger, githubApp, events) { const access_token = typeof user === 'string' ? user : user.access_token; + const log = logger.child({ name: 'github:user-auth' }); + return cache.get(`user_scoped=${access_token}`, () => { return new ProbotOctokit({ - log: logger.child({ name: 'github:user-auth' }), + + // fallout from Probot@13 migration + // + // see https://github.com/probot/probot/pull/1874#issuecomment-1837779069 + log: { + debug: log.debug.bind(log), + info: log.info.bind(log), + warn: log.warn.bind(log), + error: log.error.bind(log) + }, auth: { token: access_token }