Skip to content

Commit a06bd5b

Browse files
committed
ci(release-canary): add workflow_dispatch with package selector
Enables manual triggering from the Actions tab or gh CLI. Input: package choice (both/container/cli) to control which packages get a canary publish.
1 parent d98bd34 commit a06bd5b

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/release-canary.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,45 @@ on:
44
push:
55
branches: [staging]
66
paths: ['container/**', 'cli/**']
7+
workflow_dispatch:
8+
inputs:
9+
package:
10+
description: Which package(s) to publish
11+
type: choice
12+
options: [both, container, cli]
13+
default: both
714

815
jobs:
916
changes:
1017
runs-on: ubuntu-latest
1118
outputs:
12-
container: ${{ steps.filter.outputs.container }}
13-
cli: ${{ steps.filter.outputs.cli }}
19+
container: ${{ steps.resolve.outputs.container }}
20+
cli: ${{ steps.resolve.outputs.cli }}
1421
steps:
1522
- uses: actions/checkout@v6
23+
1624
- uses: dorny/paths-filter@v3
1725
id: filter
26+
if: github.event_name == 'push'
1827
with:
1928
filters: |
2029
container:
2130
- 'container/**'
2231
cli:
2332
- 'cli/**'
2433
34+
- name: Resolve targets
35+
id: resolve
36+
run: |
37+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+
PACKAGE="${{ inputs.package }}"
39+
echo "container=$( [ "$PACKAGE" = both ] || [ "$PACKAGE" = container ] && echo true || echo false )" >> "$GITHUB_OUTPUT"
40+
echo "cli=$( [ "$PACKAGE" = both ] || [ "$PACKAGE" = cli ] && echo true || echo false )" >> "$GITHUB_OUTPUT"
41+
else
42+
echo "container=${{ steps.filter.outputs.container }}" >> "$GITHUB_OUTPUT"
43+
echo "cli=${{ steps.filter.outputs.cli }}" >> "$GITHUB_OUTPUT"
44+
fi
45+
2546
publish-container:
2647
needs: changes
2748
if: needs.changes.outputs.container == 'true'

0 commit comments

Comments
 (0)