Skip to content

Commit

Permalink
fix: call getOctokit function instead of removed Github constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoid committed Feb 17, 2021
1 parent bee74bb commit 84dd768
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const getRangeForPushEvent = () => {
const getRangeForEvent = async () => {
if (GITHUB_EVENT_NAME !== pullRequestEvent) return getRangeForPushEvent()

const octokit = new github.GitHub(core.getInput('token'))
const octokit = github.getOctokit(core.getInput('token'))
const { owner, repo, number } = eventContext.issue
const { data: commits } = await octokit.pulls.listCommits({
owner,
Expand Down
2 changes: 1 addition & 1 deletion src/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const runAction = () => {
}

updateEnvVars({ GITHBU_TOKEN: 'test-github-token' })
td.replace(github, 'GitHub', MockOctokit)
td.replace(github, 'getOctokit', () => new MockOctokit())

return require('./action')()
}
Expand Down

0 comments on commit 84dd768

Please sign in to comment.