Skip to content

Commit f28bc31

Browse files
committed
ci: rename clawsweeper automation labels
1 parent 35cccbe commit f28bc31

4 files changed

Lines changed: 13 additions & 39 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@ jobs:
375375
return false;
376376
};
377377
378-
const isClownfishPullRequest =
379-
typeof headRefName === "string" && headRefName.startsWith("clownfish/");
378+
const isClawsweeperPullRequest =
379+
typeof headRefName === "string" && headRefName.startsWith("clawsweeper/");
380380
381-
if ((await isPrivilegedAuthor()) || isClownfishPullRequest) {
381+
if ((await isPrivilegedAuthor()) || isClawsweeperPullRequest) {
382382
if (labelNames.has(activePrLimitLabel)) {
383383
try {
384384
await github.rest.issues.removeLabel({

.github/workflows/maintainer-command-reactions.yml

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,11 @@ jobs:
1818
issues: write
1919
pull-requests: write
2020
env:
21-
CLOWNFISH_APP_ID: ${{ vars.CLOWNFISH_APP_ID || secrets.CLOWNFISH_APP_ID }}
22-
CLOWNFISH_APP_AUTH_ENABLED: ${{ secrets.CLOWNFISH_APP_PRIVATE_KEY != '' && (vars.CLOWNFISH_APP_ID != '' || secrets.CLOWNFISH_APP_ID != '') && '1' || '0' }}
23-
MAINTAINER_COMMAND_REACTIONS: ${{ vars.MAINTAINER_COMMAND_REACTIONS || '/autoclose,/clownfish autoclose,/clownfish automerge,/merge,/land,/landpr' }}
21+
MAINTAINER_COMMAND_REACTIONS: ${{ vars.MAINTAINER_COMMAND_REACTIONS || '/autoclose,/clawsweeper autoclose,/clawsweeper automerge,/merge,/land,/landpr' }}
2422
steps:
25-
- name: Create Clownfish reaction token
26-
id: clownfish-token
27-
if: ${{ env.CLOWNFISH_APP_AUTH_ENABLED == '1' }}
28-
continue-on-error: true
29-
uses: actions/create-github-app-token@v3
30-
with:
31-
app-id: ${{ env.CLOWNFISH_APP_ID }}
32-
private-key: ${{ secrets.CLOWNFISH_APP_PRIVATE_KEY }}
33-
owner: openclaw
34-
repositories: openclaw
35-
permission-issues: write
36-
3723
- name: React to maintainer slash command
3824
uses: actions/github-script@v9
3925
with:
40-
github-token: ${{ steps.clownfish-token.outputs.token || github.token }}
4126
script: |
4227
const comment = context.payload.comment;
4328
const issue = context.payload.issue;
@@ -59,13 +44,8 @@ jobs:
5944
const isAutocloseCommand =
6045
commandLine === "/autoclose" ||
6146
commandLine.startsWith("/autoclose ") ||
62-
commandLine === "/clownfish autoclose" ||
63-
commandLine.startsWith("/clownfish autoclose ");
64-
const isClownfishCommand =
65-
isAutocloseCommand ||
66-
commandLine === "/clownfish automerge" ||
67-
commandLine.startsWith("/clownfish automerge ");
68-
47+
commandLine === "/clawsweeper autoclose" ||
48+
commandLine.startsWith("/clawsweeper autoclose ");
6949
if (!issue.pull_request && !isAutocloseCommand) {
7050
core.info("Skipping non-autoclose command reaction because the comment is not on a pull request.");
7151
return;
@@ -93,12 +73,6 @@ jobs:
9373
return;
9474
}
9575
96-
const tokenIsClownfishApp = "${{ steps.clownfish-token.outputs.token != '' }}" === "true";
97-
if (isClownfishCommand && !tokenIsClownfishApp) {
98-
core.info("Skipping Clownfish command reaction because the Clownfish App token is unavailable.");
99-
return;
100-
}
101-
10276
async function react(content) {
10377
try {
10478
await github.rest.reactions.createForIssueComment({

scripts/github/barnacle-auto-response.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ const candidateActionRules = [
238238

239239
const normalizeLogin = (login) => login.toLowerCase();
240240

241-
export function isClownfishPullRequest(pullRequest) {
241+
export function isClawsweeperPullRequest(pullRequest) {
242242
const headRefName = pullRequest.headRefName ?? pullRequest.head?.ref ?? "";
243-
return typeof headRefName === "string" && headRefName.startsWith("clownfish/");
243+
return typeof headRefName === "string" && headRefName.startsWith("clawsweeper/");
244244
}
245245

246246
export function extractIssueFormValue(body, field) {
@@ -1031,7 +1031,7 @@ export async function runBarnacleAutoResponse({ github, context, core = console
10311031
if (pullRequest && labelSet.has(activePrLimitOverrideLabel)) {
10321032
labelSet.delete(activePrLimitLabel);
10331033
}
1034-
if (pullRequest && isClownfishPullRequest(pullRequest)) {
1034+
if (pullRequest && isClawsweeperPullRequest(pullRequest)) {
10351035
await removeLabels(github, context, pullRequest.number, [activePrLimitLabel], labelSet);
10361036
}
10371037

test/scripts/barnacle-auto-response.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ describe("barnacle-auto-response", () => {
290290
);
291291
});
292292

293-
it("does not close clownfish PRs for the active PR limit", async () => {
293+
it("does not close ClawSweeper PRs for the active PR limit", async () => {
294294
for (const headRef of [
295-
{ head: { ref: "clownfish/clawsweeper-openclaw-openclaw-73880" } },
296-
{ headRefName: "clownfish/clawsweeper-openclaw-openclaw-73880" },
295+
{ head: { ref: "clawsweeper/openclaw-openclaw-73880" } },
296+
{ headRefName: "clawsweeper/openclaw-openclaw-73880" },
297297
]) {
298298
const { calls, github } = barnacleGithub([]);
299299

@@ -303,7 +303,7 @@ describe("barnacle-auto-response", () => {
303303
{
304304
...headRef,
305305
user: {
306-
login: "app/openclaw-clownfish",
306+
login: "app/openclaw-clawsweeper",
307307
},
308308
},
309309
["r: too-many-prs"],

0 commit comments

Comments
 (0)