aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-17 03:21:06 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-17 03:21:06 +0300
commit6f9ac7c108e22510e1b27e3242477fac660fa4cb (patch)
tree70a1811a5a9bee6147c87394379cebeeaef7e7b6 /.github
parent99760f77db74d42108865cc412a47137b0ed384c (diff)
ci: gate Greptile reviews by contributor approval
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pr-gate.yml12
1 files changed, 12 insertions, 0 deletions
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;
}