Skip to content

Commit 47a4930

Browse files
tylerslatonjpr5
authored andcommitted
fix(ci): allow branch prerelease dispatches
1 parent de643ec commit 47a4930

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ env:
7575

7676
jobs:
7777
build:
78-
# Run on a merged release PR (normal flow) or a manual workflow_dispatch
79-
# from main (escape hatch). The main-branch guard on workflow_dispatch
80-
# prevents republishing from arbitrary branches.
78+
# Run on a merged release PR (normal flow), a stable manual dispatch from
79+
# main (retry escape hatch), or a prerelease manual dispatch from any
80+
# selected branch. Canary publishes are intentionally branch-scoped so
81+
# maintainers can push a button on feature work without merging first.
8182
if: >
82-
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') ||
83+
(github.event_name == 'workflow_dispatch' &&
84+
(inputs.mode == 'prerelease' || github.ref == 'refs/heads/main')) ||
8385
(github.event.pull_request.merged == true &&
8486
startsWith(github.event.pull_request.head.ref, 'release/publish/'))
8587
runs-on: ubuntu-latest
@@ -182,6 +184,9 @@ jobs:
182184
if: ${{ !cancelled() && needs.build.result == 'success' }}
183185
runs-on: ubuntu-latest
184186
timeout-minutes: 20
187+
# npm trusted publishing is bound to this environment. Its deployment
188+
# branch policy must allow prerelease workflow_dispatch refs; stable
189+
# releases remain main-only via the build job guard.
185190
environment: npm
186191
permissions:
187192
contents: write

0 commit comments

Comments
 (0)