From e1f50e95576f81ce01196bbdc0890b0617bf23df Mon Sep 17 00:00:00 2001 From: Mentlegen <9807008+gentlementlegen@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:00:49 +0900 Subject: [PATCH] fix: changed approval requirement check to use the configuration --- src/helpers/update-pull-requests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/update-pull-requests.ts b/src/helpers/update-pull-requests.ts index 6271c030..8743e8ae 100644 --- a/src/helpers/update-pull-requests.ts +++ b/src/helpers/update-pull-requests.ts @@ -56,7 +56,7 @@ export async function updatePullRequests(context: Context) { `Requirements according to association ${pullRequestDetails.author_association}: ${JSON.stringify(requirements)} with last activity date: ${lastActivityDate}` ); if (isNaN(lastActivityDate.getTime()) || isPastOffset(lastActivityDate, requirements.mergeTimeout)) { - if ((await getApprovalCount(context, gitHubUrl)) > 0) { + if ((await getApprovalCount(context, gitHubUrl)) > requirements.requiredApprovalCount) { if (await isCiGreen(context, pullRequestDetails.head.sha, gitHubUrl)) { context.logger.info(`Pull-request ${pullRequest.url} is past its due date (${requirements.mergeTimeout} after ${lastActivityDate}), will merge.`); await mergePullRequest(context, pullRequest, gitHubUrl);