Skip to content

Commit

Permalink
update github api
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Feb 26, 2024
1 parent 607f1f4 commit 1a8e314
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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'
Expand Down

0 comments on commit 1a8e314

Please sign in to comment.