Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/github/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Context from './context'
import {GitHub, getOctokitOptions} from './utils'

// octokit + plugins
import {OctokitOptions} from '@octokit/core/dist-types/types'
import {OctokitOptions, OctokitPlugin} from '@octokit/core/dist-types/types'

export const context = new Context.Context()

Expand All @@ -14,7 +14,12 @@ export const context = new Context.Context()
*/
export function getOctokit(
token: string,
options?: OctokitOptions
options?: OctokitOptions,
...additionalPlugins: OctokitPlugin[]
Comment thread
luketomlinson marked this conversation as resolved.
): InstanceType<typeof GitHub> {
if (additionalPlugins.length) {
Comment thread
luketomlinson marked this conversation as resolved.
Outdated
Comment thread
luketomlinson marked this conversation as resolved.
Outdated
const GitHubWithPlugins = GitHub.plugin(...additionalPlugins)
return new GitHubWithPlugins(getOctokitOptions(token, options))
}
return new GitHub(getOctokitOptions(token, options))
}