From 0cf1f2ac0fd120cdde83807833aba44252ddc9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20K=C3=B6tte?= Date: Sun, 25 Apr 2021 14:03:29 -0700 Subject: [PATCH] Fix GitHub API request (#23) --- dist/main.js | 8 ++++---- src/index.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/main.js b/dist/main.js index 37713b97..8faf789a 100644 --- a/dist/main.js +++ b/dist/main.js @@ -6228,7 +6228,7 @@ async function main() { console.log(`No coverage report found at '${baseFile}', ignoring...`); } - const pull_request = await octokit.pulls.get({ + const { data } = await octokit.pulls.get({ owner: github_2.repo.owner, repo: github_2.repo.repo, pull_number: pr_number, @@ -6237,9 +6237,9 @@ async function main() { const options = { repository: github_2.payload.repository.full_name, prefix: `${process.env.GITHUB_WORKSPACE}/`, - commit: pull_request.head.sha, - head: pull_request.head.ref, - base: pull_request.base.ref, + commit: data.head.sha, + head: data.head.ref, + base: data.base.ref, }; const lcov = await parse(raw); diff --git a/src/index.js b/src/index.js index 33113a05..fdb6cd49 100644 --- a/src/index.js +++ b/src/index.js @@ -25,7 +25,7 @@ async function main() { console.log(`No coverage report found at '${baseFile}', ignoring...`); } - const pull_request = await octokit.pulls.get({ + const { data } = await octokit.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, pull_number: pr_number, @@ -34,9 +34,9 @@ async function main() { const options = { repository: context.payload.repository.full_name, prefix: `${process.env.GITHUB_WORKSPACE}/`, - commit: pull_request.head.sha, - head: pull_request.head.ref, - base: pull_request.base.ref, + commit: data.head.sha, + head: data.head.ref, + base: data.base.ref, }; const lcov = await parse(raw);