File tree Expand file tree Collapse file tree 1 file changed +1
-37
lines changed Expand file tree Collapse file tree 1 file changed +1
-37
lines changed Original file line number Diff line number Diff line change @@ -4,43 +4,7 @@ import { paginateRest } from "@octokit/plugin-paginate-rest";
4
4
5
5
import { VERSION } from "./version" ;
6
6
7
- const CoreWithPlugins = Core . plugin ( [ paginateRest ] ) ;
8
-
9
- // Workaround for TypeScript bug, see https://github.com/octokit/core.js#a-note-on-typescript
10
- import {
11
- OctokitOptions ,
12
- OctokitPlugin ,
13
- ReturnTypeOf ,
14
- Constructor
15
- } from "@octokit/core" ;
16
-
17
- /* istanbul ignore next */
18
- class CoreWithPluginsWorkaround extends CoreWithPlugins {
19
- static plugin < T extends OctokitPlugin | OctokitPlugin [ ] > ( pluginOrPlugins : T ) {
20
- const currentPlugins = this . plugins ;
21
- const newPlugins = Array . isArray ( pluginOrPlugins )
22
- ? pluginOrPlugins
23
- : [ pluginOrPlugins ] ;
24
-
25
- const NewOctokit = class extends this {
26
- static plugins = currentPlugins . concat (
27
- newPlugins . filter ( plugin => ! currentPlugins . includes ( plugin ) )
28
- ) ;
29
- } ;
30
-
31
- return NewOctokit as typeof NewOctokit & Constructor < ReturnTypeOf < T > > ;
32
- }
33
-
34
- static defaults ( defaults : OctokitOptions ) {
35
- return class OctokitWithDefaults extends this {
36
- constructor ( options : OctokitOptions = { } ) {
37
- super ( Object . assign ( { } , defaults , options ) ) ;
38
- }
39
- } ;
40
- }
41
- }
42
-
43
- export const Octokit = CoreWithPluginsWorkaround . defaults ( {
7
+ export const Octokit = Core . plugin ( [ paginateRest ] ) . defaults ( {
44
8
authStrategy : createActionAuth ,
45
9
userAgent : `octokit-action.js/${ VERSION } `
46
10
} ) ;
You can’t perform that action at this time.
0 commit comments