diff --git a/.github/workflows/plugin-clawhub-release.yml b/.github/workflows/plugin-clawhub-release.yml index 5b552df8e751..775f1feb40ac 100644 --- a/.github/workflows/plugin-clawhub-release.yml +++ b/.github/workflows/plugin-clawhub-release.yml @@ -56,12 +56,6 @@ jobs: ref: ${{ github.ref }} fetch-depth: 0 - - name: Setup Node environment - uses: ./.github/actions/setup-node-env - with: - node-version: ${{ env.NODE_VERSION }} - install-bun: "false" - - name: Resolve checked-out ref id: ref env: @@ -107,6 +101,12 @@ jobs: echo "Plugin ClawHub publishes must target a commit reachable from main, release/*, or the matching Tideclaw alpha branch." >&2 exit 1 + - name: Setup Node environment + uses: ./.github/actions/setup-node-env + with: + node-version: ${{ env.NODE_VERSION }} + install-bun: "false" + - name: Validate publishable plugin metadata env: PUBLISH_SCOPE: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_scope || '' }} diff --git a/test/scripts/package-acceptance-workflow.test.ts b/test/scripts/package-acceptance-workflow.test.ts index 4854492a460a..c0900d1ba9e9 100644 --- a/test/scripts/package-acceptance-workflow.test.ts +++ b/test/scripts/package-acceptance-workflow.test.ts @@ -1543,6 +1543,14 @@ describe("package artifact reuse", () => { const pluginNpmWorkflow = readFileSync(".github/workflows/plugin-npm-release.yml", "utf8"); const openclawNpmWorkflow = readFileSync(".github/workflows/openclaw-npm-release.yml", "utf8"); const approvalScript = readFileSync("scripts/validate-release-publish-approval.mjs", "utf8"); + const clawHubResolveRefIndex = clawHubWorkflow.indexOf("- name: Resolve checked-out ref"); + const clawHubValidateRefIndex = clawHubWorkflow.indexOf( + "- name: Validate ref is on a trusted publish branch", + ); + const clawHubSetupIndex = clawHubWorkflow.indexOf("- name: Setup Node environment"); + const clawHubMetadataIndex = clawHubWorkflow.indexOf( + "- name: Validate publishable plugin metadata", + ); expect(packageJson.scripts?.["release:verify-beta"]).toBe( "node --import tsx scripts/release-verify-beta.ts", @@ -1559,6 +1567,10 @@ describe("package artifact reuse", () => { expect(clawHubWorkflow).toContain("Verify published ClawHub package"); expect(clawHubWorkflow).toContain("bun install failed while preparing ClawHub CLI; retrying"); expect(clawHubWorkflow).toContain("max-parallel: 32"); + expect(clawHubResolveRefIndex).toBeGreaterThanOrEqual(0); + expect(clawHubValidateRefIndex).toBeGreaterThan(clawHubResolveRefIndex); + expect(clawHubSetupIndex).toBeGreaterThan(clawHubValidateRefIndex); + expect(clawHubMetadataIndex).toBeGreaterThan(clawHubSetupIndex); expect(releaseWorkflow).toContain("Plugin npm run ID"); expect(releaseWorkflow).toContain("Plugin ClawHub run ID"); expect(releaseWorkflow).toContain("OpenClaw npm run ID");