5
0
Fork 0
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:
Wagner Santos 2021-02-17 10:51:11 -03:00
parent bee74bb12f
commit 84dd7685c6
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ const getRangeForPushEvent = () => {
const getRangeForEvent = async () => { const getRangeForEvent = async () => {
if (GITHUB_EVENT_NAME !== pullRequestEvent) return getRangeForPushEvent() 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 { owner, repo, number } = eventContext.issue
const { data: commits } = await octokit.pulls.listCommits({ const { data: commits } = await octokit.pulls.listCommits({
owner, owner,

View file

@ -32,7 +32,7 @@ const runAction = () => {
} }
updateEnvVars({ GITHBU_TOKEN: 'test-github-token' }) updateEnvVars({ GITHBU_TOKEN: 'test-github-token' })
td.replace(github, 'GitHub', MockOctokit) td.replace(github, 'getOctokit', () => new MockOctokit())
return require('./action')() return require('./action')()
} }