Skip to content

Commit 5be0e95

Browse files
fix: let clawhub dry runs skip publish approval
1 parent 84acb74 commit 5be0e95

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/plugin-clawhub-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ jobs:
430430

431431
approve_plugin_clawhub_release:
432432
needs: [preview_plugins_clawhub, pack_plugins_clawhub_artifacts]
433-
if: github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true'
433+
if: github.event_name == 'workflow_dispatch' && inputs.dry_run != true && needs.preview_plugins_clawhub.outputs.has_candidates == 'true'
434434
runs-on: ubuntu-latest
435435
environment: clawhub-plugin-release
436436
permissions: {}
@@ -440,7 +440,7 @@ jobs:
440440

441441
publish_plugins_clawhub:
442442
needs: [preview_plugins_clawhub, pack_plugins_clawhub_artifacts, approve_plugin_clawhub_release]
443-
if: github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true'
443+
if: always() && github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' && needs.pack_plugins_clawhub_artifacts.result == 'success' && (inputs.dry_run == true || needs.approve_plugin_clawhub_release.result == 'success')
444444
permissions:
445445
actions: read
446446
contents: read

test/scripts/package-acceptance-workflow.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,11 @@ describe("package artifact reuse", () => {
15711571
expect(clawHubWorkflow).toContain("dry_run:");
15721572
expect(clawHubWorkflow).toContain("default: false");
15731573
expect(clawHubWorkflow).toContain("approve_plugin_clawhub_release:");
1574+
expect(clawHubWorkflow).toContain("inputs.dry_run != true");
15741575
expect(clawHubWorkflow).toContain("Approve ClawHub package publish");
1576+
expect(clawHubWorkflow).toContain(
1577+
"always() && github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' && needs.pack_plugins_clawhub_artifacts.result == 'success' && (inputs.dry_run == true || needs.approve_plugin_clawhub_release.result == 'success')",
1578+
);
15751579
expect(clawHubWorkflow).toContain(
15761580
"uses: openclaw/clawhub/.github/workflows/package-publish.yml@c9bb13023598dcc547fdf4a93b9d42512b8c8854",
15771581
);

0 commit comments

Comments
 (0)