Skip to content

Commit

Permalink
fix(app): pre-bind log
Browse files Browse the repository at this point in the history
This is necessary with probot@13, see probot/probot#1874 (comment).
  • Loading branch information
nikku committed Jan 31, 2024
1 parent f140aea commit d71a0a8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/app/lib/apps/github-client/GithubClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d71a0a8

Please sign in to comment.