Skip to content

Commit 5624dc4

Browse files
committed
ci(release-please): Add manual workflow_dispatch to re-run publish-cli only
Re-running the full release workflow is unsafe once publish-packages has published logger/fs/builder/server/project — republishing would fail with 403. This dispatch path runs only publish-cli against current main, gated by a required 'publish-cli' confirmation input. This is the recovery path for the alpha.5 release, where publish-cli failed due to a shrinkwrap-extractor bug (fixed in #1429).
1 parent 36c7f9f commit 5624dc4

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
8+
inputs:
9+
confirm_publish_cli:
10+
description: "Type 'publish-cli' to re-run only the publish-cli job against the current main (e.g. when a prior run failed after the other packages were already published). The version published is whatever is in packages/cli/package.json on main."
11+
required: true
12+
type: string
713

814
permissions: {}
915

1016
jobs:
1117
release-please:
18+
# Skip on manual dispatch: the manual path exists only to re-run publish-cli.
19+
if: github.event_name != 'workflow_dispatch'
1220
runs-on: ubuntu-24.04
1321
permissions:
1422
contents: write
@@ -59,7 +67,9 @@ jobs:
5967
publish-packages:
6068
runs-on: ubuntu-24.04
6169
needs: release-please
62-
if: needs.release-please.outputs.releases_created == 'true'
70+
# Never run on manual dispatch — the manual path is only for re-running publish-cli when the
71+
# other packages were already published in a prior run. Republishing them would fail with 403.
72+
if: github.event_name != 'workflow_dispatch' && needs.release-please.outputs.releases_created == 'true'
6373
permissions:
6474
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
6575
# The GitHub Actions Environment configured for the trusted publisher
@@ -90,7 +100,22 @@ jobs:
90100
publish-cli:
91101
runs-on: ubuntu-24.04
92102
needs: [release-please, publish-packages]
93-
if: needs.release-please.outputs.releases_created == 'true'
103+
# Two paths:
104+
# 1. Automatic: release-please created releases and publish-packages succeeded
105+
# 2. Manual: workflow_dispatch with the confirmation input set to "publish-cli"
106+
# `always()` is required so this job is not auto-skipped when the upstream jobs are skipped
107+
# on the manual path.
108+
if: |
109+
always() && (
110+
(
111+
github.event_name == 'push'
112+
&& needs.release-please.outputs.releases_created == 'true'
113+
&& needs.publish-packages.result == 'success'
114+
) || (
115+
github.event_name == 'workflow_dispatch'
116+
&& inputs.confirm_publish_cli == 'publish-cli'
117+
)
118+
)
94119
permissions:
95120
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
96121
# The GitHub Actions Environment configured for the trusted publisher

0 commit comments

Comments
 (0)