diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 1186e5d677e..fd8ec78ff8c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -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({ diff --git a/.github/workflows/maintainer-command-reactions.yml b/.github/workflows/maintainer-command-reactions.yml index b45224b342b..8a334faa032 100644 --- a/.github/workflows/maintainer-command-reactions.yml +++ b/.github/workflows/maintainer-command-reactions.yml @@ -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({ diff --git a/scripts/github/barnacle-auto-response.mjs b/scripts/github/barnacle-auto-response.mjs index 6d13644dbbf..7273db8a201 100644 --- a/scripts/github/barnacle-auto-response.mjs +++ b/scripts/github/barnacle-auto-response.mjs @@ -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); } diff --git a/test/scripts/barnacle-auto-response.test.ts b/test/scripts/barnacle-auto-response.test.ts index d79d0d31cdd..d64e2202340 100644 --- a/test/scripts/barnacle-auto-response.test.ts +++ b/test/scripts/barnacle-auto-response.test.ts @@ -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"],