ci: rename clawsweeper automation labels

This commit is contained in:
Peter Steinberger
2026-04-29 10:18:57 +01:00
parent 35cccbeb68
commit f28bc31ecd
4 changed files with 13 additions and 39 deletions

View File

@@ -375,10 +375,10 @@ jobs:
return false;
};
const isClownfishPullRequest =
typeof headRefName === "string" && headRefName.startsWith("clownfish/");
const isClawsweeperPullRequest =
typeof headRefName === "string" && headRefName.startsWith("clawsweeper/");
if ((await isPrivilegedAuthor()) || isClownfishPullRequest) {
if ((await isPrivilegedAuthor()) || isClawsweeperPullRequest) {
if (labelNames.has(activePrLimitLabel)) {
try {
await github.rest.issues.removeLabel({

View File

@@ -18,26 +18,11 @@ jobs:
issues: write
pull-requests: write
env:
CLOWNFISH_APP_ID: ${{ vars.CLOWNFISH_APP_ID || secrets.CLOWNFISH_APP_ID }}
CLOWNFISH_APP_AUTH_ENABLED: ${{ secrets.CLOWNFISH_APP_PRIVATE_KEY != '' && (vars.CLOWNFISH_APP_ID != '' || secrets.CLOWNFISH_APP_ID != '') && '1' || '0' }}
MAINTAINER_COMMAND_REACTIONS: ${{ vars.MAINTAINER_COMMAND_REACTIONS || '/autoclose,/clownfish autoclose,/clownfish automerge,/merge,/land,/landpr' }}
MAINTAINER_COMMAND_REACTIONS: ${{ vars.MAINTAINER_COMMAND_REACTIONS || '/autoclose,/clawsweeper autoclose,/clawsweeper automerge,/merge,/land,/landpr' }}
steps:
- name: Create Clownfish reaction token
id: clownfish-token
if: ${{ env.CLOWNFISH_APP_AUTH_ENABLED == '1' }}
continue-on-error: true
uses: actions/create-github-app-token@v3
with:
app-id: ${{ env.CLOWNFISH_APP_ID }}
private-key: ${{ secrets.CLOWNFISH_APP_PRIVATE_KEY }}
owner: openclaw
repositories: openclaw
permission-issues: write
- name: React to maintainer slash command
uses: actions/github-script@v9
with:
github-token: ${{ steps.clownfish-token.outputs.token || github.token }}
script: |
const comment = context.payload.comment;
const issue = context.payload.issue;
@@ -59,13 +44,8 @@ jobs:
const isAutocloseCommand =
commandLine === "/autoclose" ||
commandLine.startsWith("/autoclose ") ||
commandLine === "/clownfish autoclose" ||
commandLine.startsWith("/clownfish autoclose ");
const isClownfishCommand =
isAutocloseCommand ||
commandLine === "/clownfish automerge" ||
commandLine.startsWith("/clownfish automerge ");
commandLine === "/clawsweeper autoclose" ||
commandLine.startsWith("/clawsweeper autoclose ");
if (!issue.pull_request && !isAutocloseCommand) {
core.info("Skipping non-autoclose command reaction because the comment is not on a pull request.");
return;
@@ -93,12 +73,6 @@ jobs:
return;
}
const tokenIsClownfishApp = "${{ steps.clownfish-token.outputs.token != '' }}" === "true";
if (isClownfishCommand && !tokenIsClownfishApp) {
core.info("Skipping Clownfish command reaction because the Clownfish App token is unavailable.");
return;
}
async function react(content) {
try {
await github.rest.reactions.createForIssueComment({

View File

@@ -238,9 +238,9 @@ const candidateActionRules = [
const normalizeLogin = (login) => login.toLowerCase();
export function isClownfishPullRequest(pullRequest) {
export function isClawsweeperPullRequest(pullRequest) {
const headRefName = pullRequest.headRefName ?? pullRequest.head?.ref ?? "";
return typeof headRefName === "string" && headRefName.startsWith("clownfish/");
return typeof headRefName === "string" && headRefName.startsWith("clawsweeper/");
}
export function extractIssueFormValue(body, field) {
@@ -1031,7 +1031,7 @@ export async function runBarnacleAutoResponse({ github, context, core = console
if (pullRequest && labelSet.has(activePrLimitOverrideLabel)) {
labelSet.delete(activePrLimitLabel);
}
if (pullRequest && isClownfishPullRequest(pullRequest)) {
if (pullRequest && isClawsweeperPullRequest(pullRequest)) {
await removeLabels(github, context, pullRequest.number, [activePrLimitLabel], labelSet);
}

View File

@@ -290,10 +290,10 @@ describe("barnacle-auto-response", () => {
);
});
it("does not close clownfish PRs for the active PR limit", async () => {
it("does not close ClawSweeper PRs for the active PR limit", async () => {
for (const headRef of [
{ head: { ref: "clownfish/clawsweeper-openclaw-openclaw-73880" } },
{ headRefName: "clownfish/clawsweeper-openclaw-openclaw-73880" },
{ head: { ref: "clawsweeper/openclaw-openclaw-73880" } },
{ headRefName: "clawsweeper/openclaw-openclaw-73880" },
]) {
const { calls, github } = barnacleGithub([]);
@@ -303,7 +303,7 @@ describe("barnacle-auto-response", () => {
{
...headRef,
user: {
login: "app/openclaw-clownfish",
login: "app/openclaw-clawsweeper",
},
},
["r: too-many-prs"],