Skip to content

Commit

Permalink
one more?
Browse files Browse the repository at this point in the history
  • Loading branch information
leopic committed Aug 12, 2024
1 parent 34f8dea commit c05268a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/actions/time-to-first-review/src/fetch-reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ module.exports = async (repo, token, prNumber) => {
try {
const octokit = github.getOctokit(token);

const { data: reviews } = await octokit.rest.pulls.get({
const reviews = await octokit.rest.pulls.get({
owner: repo.split("/")[0],
repo: repo.split("/")[1],
pull_number: prNumber,
});

return reviews;
console.log(reviews);

// const response = await axios.get(
// `https://api.github.com/repos/${repo}/pulls/${prNumber}/reviews`,
// {
// headers: { Authorization: `token ${token}` },
// }
// );
// return response.data;
return reviews;
} catch (error) {
console.error(`Error fetching reviews for PR #${prNumber}:`, error.message);
return [];
Expand Down

0 comments on commit c05268a

Please sign in to comment.