mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
fix: call getOctokit function instead of removed Github constructor
This commit is contained in:
parent
bee74bb12f
commit
84dd7685c6
2 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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')()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue