Skip to content

Commit

Permalink
Update style
Browse files Browse the repository at this point in the history
  • Loading branch information
hross committed Nov 26, 2019
1 parent 45f087f commit 6ad1418
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/github/src/github.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
import {graphql} from '@octokit/graphql'

// we need this type to set up a property on the GitHub object
// that has token authorization
// (it is not exported from oktokit by default)
import {graphql as GraphQL} from '@octokit/graphql/dist-types/types'

import Octokit from '@octokit/rest'
import * as Context from './context'
import * as Context from './context';

// We need this in order to extend Octokit
Octokit.prototype = new Octokit()
Octokit.prototype = new Octokit();

export const context = new Context.Context()
export const context = new Context.Context();

export class GitHub extends Octokit {
graphql: GraphQL
public graphql: GraphQL;

constructor(token: string, opts: Omit<Octokit.Options, 'auth'> = {}) {
super({...opts, auth: `token ${token}`})
super({...opts, auth: `token ${token}`});

this.graphql = graphql.defaults({
headers: {authorization: `token ${token}`}
})
});
}
}

0 comments on commit 6ad1418

Please sign in to comment.