From f0a33b7881b8866131a1443cd957b906a9154850 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Mon, 26 Feb 2024 09:15:35 +0100 Subject: [PATCH 1/3] test From 607f1f4b1f15edb108fd29f2d1414899c849c166 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Mon, 26 Feb 2024 09:17:18 +0100 Subject: [PATCH 2/3] add build during ci --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76c2ce19..799977bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: From 1a8e31430baa97fc8f2f01dd005cb47cd68a5d81 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Mon, 26 Feb 2024 09:18:25 +0100 Subject: [PATCH 3/3] update github api --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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'