Commit 6ad1418 1 parent 45f087f commit 6ad1418 Copy full SHA for 6ad1418
File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
2
2
import { graphql } from '@octokit/graphql'
3
+
4
+ // we need this type to set up a property on the GitHub object
5
+ // that has token authorization
6
+ // (it is not exported from oktokit by default)
3
7
import { graphql as GraphQL } from '@octokit/graphql/dist-types/types'
8
+
4
9
import Octokit from '@octokit/rest'
5
- import * as Context from './context'
10
+ import * as Context from './context' ;
6
11
7
12
// We need this in order to extend Octokit
8
- Octokit . prototype = new Octokit ( )
13
+ Octokit . prototype = new Octokit ( ) ;
9
14
10
- export const context = new Context . Context ( )
15
+ export const context = new Context . Context ( ) ;
11
16
12
17
export class GitHub extends Octokit {
13
- graphql : GraphQL
18
+ public graphql : GraphQL ;
19
+
14
20
constructor ( token : string , opts : Omit < Octokit . Options , 'auth' > = { } ) {
15
- super ( { ...opts , auth : `token ${ token } ` } )
21
+ super ( { ...opts , auth : `token ${ token } ` } ) ;
16
22
17
23
this . graphql = graphql . defaults ( {
18
24
headers : { authorization : `token ${ token } ` }
19
- } )
25
+ } ) ;
20
26
}
21
27
}
You can’t perform that action at this time.
0 commit comments