Skip to content

Commit 84dd768

Browse files
committed
fix: call getOctokit function instead of removed Github constructor
1 parent bee74bb commit 84dd768

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/action.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const getRangeForPushEvent = () => {
4747
const getRangeForEvent = async () => {
4848
if (GITHUB_EVENT_NAME !== pullRequestEvent) return getRangeForPushEvent()
4949

50-
const octokit = new github.GitHub(core.getInput('token'))
50+
const octokit = github.getOctokit(core.getInput('token'))
5151
const { owner, repo, number } = eventContext.issue
5252
const { data: commits } = await octokit.pulls.listCommits({
5353
owner,

src/action.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const runAction = () => {
3232
}
3333

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

3737
return require('./action')()
3838
}

0 commit comments

Comments
 (0)