fix: prevent barnacle vetoing clawsweeper proof

This commit is contained in:
Shadow
2026-05-15 22:25:11 -05:00
parent 372a8e4d22
commit 90ae151154
2 changed files with 37 additions and 0 deletions

View File

@@ -828,6 +828,16 @@ function isAutomationActor(context) {
return isAutomationUser(context.payload.sender, context.actor ?? "");
}
function isClawSweeperProofSufficientLabelEvent(context) {
const senderLogin = context.payload.sender?.login ?? context.actor ?? "";
return (
context.payload.action === "labeled" &&
context.payload.label?.name === PROOF_SUFFICIENT_LABEL &&
isAutomationUser(context.payload.sender, senderLogin) &&
/clawsweeper/i.test(senderLogin)
);
}
function isGitHubAppPullRequestAuthor(pullRequest) {
return isAutomationUser(pullRequest.user);
}
@@ -1075,6 +1085,13 @@ export async function runBarnacleAutoResponse({ github, context, core = console
return;
}
if (isClawSweeperProofSufficientLabelEvent(context)) {
core.info(
`Skipping PR auto-response checks for #${pullRequest.number} because ClawSweeper owns ${PROOF_SUFFICIENT_LABEL}.`,
);
return;
}
if (isGitHubAppPullRequestAuthor(pullRequest)) {
await removeLabels(github, context, pullRequest.number, [activePrLimitLabel], labelSet);
core.info(`Skipping active PR limit for GitHub App-authored PR #${pullRequest.number}.`);