diff --git a/index.js b/index.js index 0bd06bfc..92e5cc8e 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ 'use strict' const core = require('@actions/core') -const { GitHub, context } = require('@actions/github') +const github = require('@actions/github') const main = async () => { const token = core.getInput('github-token') @@ -13,12 +13,12 @@ const main = async () => { const [owner, repo] = repoString.split('/') repoObject = { owner, repo } } else { - repoObject = context.repo + repoObject = github.context.repo } - const octokit = new GitHub(token) + const octokit = github.getOctokit(token) - await octokit.pulls.createReview({ + await octokit.rest.pulls.createReview({ ...repoObject, pull_number: number, event: 'APPROVE'