mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-16 07:09:29 +00:00
CI: close PRs with excessive labels
This commit is contained in:
20
.github/workflows/auto-response.yml
vendored
20
.github/workflows/auto-response.yml
vendored
@@ -105,6 +105,26 @@ jobs:
|
||||
}
|
||||
}
|
||||
|
||||
const pullRequest = context.payload.pull_request;
|
||||
if (pullRequest) {
|
||||
const labelCount = pullRequest.labels?.length ?? 0;
|
||||
if (labelCount > 20) {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: "Closing this PR because it has more than 20 labels, which usually means the branch is too noisy. Please recreate the PR from a clean branch.",
|
||||
});
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pullRequest.number,
|
||||
state: "closed",
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const labelName = context.payload.label?.name;
|
||||
if (!labelName) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user