chore: remove extra request - not needed as we already have the PR and only use it for the author.

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-01-19 10:35:46 +01:00
parent 0981cb2f57
commit 21d2908351
+2 -8
View File
@@ -91,7 +91,7 @@ module.exports = async ({ github, context, core }) => {
// if all required reviewers have reviewed
if (hasReviewed.size === expectedReviewers.size) {
const recentEventsForPR = await github.paginate(
github.issues.listEvents,
github.rest.issues.listEvents,
{
issue_number: pullRequest.number,
owner: context.repo.owner,
@@ -99,16 +99,10 @@ module.exports = async ({ github, context, core }) => {
},
);
const { data: pr } = await github.pulls.get({
issue_number: pullRequest.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
// if the last event for the issue is not by the author, remove the label
if (
recentEventsForPR[recentEventsForPR.length - 1].actor.login !==
pr.author.login
pullRequest.author.login
) {
await github.rest.issues
.removeLabel({