Skip to content

Commit 1c2402c

Browse files
authored
Merge pull request #4580 from Agenta-AI/ci/pr-contribution-allowlist
ci: exempt private org members from PR contribution check
2 parents a81e5c9 + 5712d01 commit 1c2402c

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/13-check-pr-contribution.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ jobs:
5151
const LABEL = 'incomplete-pr';
5252
const INTERNAL = ['OWNER', 'MEMBER', 'COLLABORATOR'];
5353
54+
// author_association reports MEMBER only for *public* org members. Private
55+
// members fall back to CONTRIBUTOR because this workflow's GITHUB_TOKEN
56+
// cannot see private membership, so list internal handles explicitly here.
57+
// Add a handle whenever a teammate with private org membership joins.
58+
const ALLOWLIST = [
59+
'mmabrouk',
60+
'jp-agenta',
61+
'ardaerzin',
62+
'ashrafchowdury',
63+
'bekossy',
64+
'junaway',
65+
].map((h) => h.toLowerCase());
66+
5467
// Files that are non-functional. A PR touching only these may skip the demo.
5568
const EXEMPT = [
5669
/(^|\/)tests?\//i,
@@ -100,8 +113,13 @@ jobs:
100113
return;
101114
}
102115
103-
// Exempt internal contributors (org members) and bots.
104-
if (!forceExternal && (pr.user.type === 'Bot' || INTERNAL.includes(pr.author_association))) {
116+
// Exempt internal contributors and bots. Check both the GitHub-reported
117+
// association (covers public org members) and the explicit allowlist
118+
// (covers private org members the token cannot see as MEMBER).
119+
const isInternal =
120+
INTERNAL.includes(pr.author_association) ||
121+
ALLOWLIST.includes(pr.user.login.toLowerCase());
122+
if (!forceExternal && (pr.user.type === 'Bot' || isInternal)) {
105123
core.info(`PR #${number} by ${pr.user.login} (${pr.author_association}) is internal, skipping.`);
106124
return;
107125
}

0 commit comments

Comments
 (0)