Skip to content

Commit

Permalink
fix: auth-app expects for options.request an object of type RequestIn…
Browse files Browse the repository at this point in the history
…terface (#1935)

* fix: state.request

* Apply suggestions from code review

Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>

* fix

* fix

* improve coverage

* simplify

---------

Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>
  • Loading branch information
Uzlopak and wolfy1339 committed Dec 4, 2023
1 parent f515b6a commit ce520b0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/octokit/get-probot-octokit-with-defaults.ts
@@ -1,6 +1,7 @@
import type { LRUCache } from "lru-cache";
import { ProbotOctokit } from "./probot-octokit.js";
import type { RedisOptions } from "ioredis";
import { request } from "@octokit/request";

import { getOctokitThrottleOptions } from "./get-octokit-throttle-options.js";

Expand Down Expand Up @@ -35,13 +36,21 @@ export function getProbotOctokitWithDefaults(options: Options) {
const authOptions = options.githubToken
? {
token: options.githubToken,
request: options.request,
request: request.defaults({
request: {
fetch: options.request?.fetch,
},
}),
}
: {
cache: options.cache,
appId: options.appId,
privateKey: options.privateKey,
request: options.request,
request: request.defaults({
request: {
fetch: options.request?.fetch,
},
}),
};

const octokitThrottleOptions = getOctokitThrottleOptions({
Expand Down

0 comments on commit ce520b0

Please sign in to comment.