fix: harden contribution gate bypasses

This commit is contained in:
Nightt
2026-06-02 10:39:48 +08:00
committed by Hunter B
parent 97c615ca9c
commit dcf8350ff8
3 changed files with 9 additions and 3 deletions
@@ -42,6 +42,15 @@ jobs:
});
return;
}
if (scope === 'issue' && issue.pull_request) {
await github.rest.issues.createComment({
owner,
repo,
issue_number: issue.number,
body: '`/lgtmi` grants issue access and must be used on an issue. Use `/lgtm` to grant PR access.',
});
return;
}
const path = '.github/APPROVED_CONTRIBUTORS';
const targetLogin = issue.user.login;
-1
View File
@@ -55,7 +55,6 @@ jobs:
const allowlist = await readAllowlist();
const login = issue.user.login.toLowerCase();
if (
allowlist.has(login) ||
allowlist.has(`all:${login}`) ||
allowlist.has(`issue:${login}`)
) {
-2
View File
@@ -24,7 +24,6 @@ jobs:
if (privileged.has(pr.author_association)) return;
if (pr.user.login === 'github-actions[bot]') return;
if ((pr.head.ref || '').startsWith('contribution-gate/')) return;
function parseAllowlist(content) {
return new Set(
@@ -56,7 +55,6 @@ jobs:
const allowlist = await readAllowlist();
const login = pr.user.login.toLowerCase();
if (
allowlist.has(login) ||
allowlist.has(`all:${login}`) ||
allowlist.has(`pr:${login}`)
) {