From 6f9ac7c108e22510e1b27e3242477fac660fa4cb Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 17 Jul 2026 03:21:06 +0300 Subject: ci: gate Greptile reviews by contributor approval --- .github/workflows/pr-gate.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pr-gate.yml b/.github/workflows/pr-gate.yml index 5cc7f8f1..289d39db 100644 --- a/.github/workflows/pr-gate.yml +++ b/.github/workflows/pr-gate.yml @@ -56,6 +56,15 @@ jobs: return Buffer.from(fileContent.content, 'base64').toString('utf8'); } + async function addGreptileReviewLabel() { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['greptile-review'], + }); + } + async function closePullRequest(message) { await github.rest.issues.createComment({ owner: context.repo.owner, @@ -75,6 +84,7 @@ jobs: const authorPermission = await getPermission(prAuthor); if (maintainerPermissions.includes(authorPermission)) { console.log(`${prAuthor} is a collaborator with ${authorPermission} access`); + await addGreptileReviewLabel(); return; } @@ -82,6 +92,7 @@ jobs: const reopenerPermission = reopener ? await getPermission(reopener) : null; if (maintainerPermissions.includes(reopenerPermission)) { console.log(`${reopener} reopened this PR with ${reopenerPermission} access; leaving it open`); + await addGreptileReviewLabel(); return; } } @@ -95,6 +106,7 @@ jobs: if (isApprovedContributor) { console.log(`${prAuthor} is in the approved contributors list`); + await addGreptileReviewLabel(); return; } -- cgit v1.2.3