aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/pr-gate.yml
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-21 21:53:03 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-21 21:53:39 +0300
commitcef5c37e5978c48d05be2745a76c813faf8f6ebd (patch)
tree14a6386200206b687be2065d7f72e6ca094f52c8 /.github/workflows/pr-gate.yml
parente6cbbdb9e384473e4e492e3fcb6e3fe06c2b15ff (diff)
fix: allow maintainer reopened prs through gate
Diffstat (limited to '.github/workflows/pr-gate.yml')
-rw-r--r--.github/workflows/pr-gate.yml17
1 files changed, 14 insertions, 3 deletions
diff --git a/.github/workflows/pr-gate.yml b/.github/workflows/pr-gate.yml
index 2083569f..3621f008 100644
--- a/.github/workflows/pr-gate.yml
+++ b/.github/workflows/pr-gate.yml
@@ -17,7 +17,10 @@ jobs:
with:
script: |
const prAuthor = context.payload.pull_request.user.login;
+ const reopener = context.payload.sender?.login ?? null;
+ const action = context.payload.action;
const defaultBranch = context.payload.repository.default_branch;
+ const maintainerPermissions = ['admin', 'maintain', 'write'];
if (prAuthor.endsWith('[bot]') || prAuthor === 'dependabot[bot]') {
console.log(`Skipping bot: ${prAuthor}`);
@@ -68,12 +71,20 @@ jobs:
});
}
- const permission = await getPermission(prAuthor);
- if (['admin', 'maintain', 'write'].includes(permission)) {
- console.log(`${prAuthor} is a collaborator with ${permission} access`);
+ const authorPermission = await getPermission(prAuthor);
+ if (maintainerPermissions.includes(authorPermission)) {
+ console.log(`${prAuthor} is a collaborator with ${authorPermission} access`);
return;
}
+ if (action === 'reopened') {
+ const reopenerPermission = reopener ? await getPermission(reopener) : null;
+ if (maintainerPermissions.includes(reopenerPermission)) {
+ console.log(`${reopener} reopened this PR with ${reopenerPermission} access; leaving it open`);
+ return;
+ }
+ }
+
const approvedContent = await getTextFile('.github/APPROVED_CONTRIBUTORS');
const approvedList = approvedContent
.split('\n')