Skip to content

Commit

Permalink
Fix GitHub API. Closes #71 (#72)
Browse files Browse the repository at this point in the history
* test

* add build during ci

* update github api
  • Loading branch information
juliangruber authored Feb 26, 2024
1 parent 3b184ad commit 19528c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: npm install and build
run: |
npm ci
npm run build
- name: Approve Pull Request
uses: ./
with:
Expand Down
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 19528c0

Please sign in to comment.