Skip to content

armgit / herdr

Public Imported from GitHub
0

the runtime your coding agents live on

ci: gate Greptile reviews by contributor approval

Ogulcan Celik6f9ac7c108e2
diff --git a/.github/workflows/pr-gate.yml b/.github/workflows/pr-gate.yml
index 5cc7f8f11..289d39dbb 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;
}