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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user