Skip to content

Commit

Permalink
Merge pull request #5 from boennemann/feat-github-config
Browse files Browse the repository at this point in the history
feat: allow passing a github instance
  • Loading branch information
boennemann committed Nov 27, 2015
2 parents 0431c15 + e31eacc commit 65d11a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ module.exports = async function (config, callback) {
} = config

try {
const github = new GitHubApi({
version: '3.0.0'
})
let github = config.github

github.authenticate({type: 'oauth', token})
if (!github) {
github = new GitHubApi({
version: '3.0.0'
})

github.authenticate({type: 'oauth', token})
}

const content = await contentFromFilename(github, config)
const newContent = transform(content.content)
Expand Down

0 comments on commit 65d11a0

Please sign in to comment.