You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): merge prerelease.yml into publish-release.yml (single OIDC entry point) (CopilotKit#5071)
## Why
npm OIDC trusted publishers match on the **caller's** `workflow_ref`
claim, not the callee's `job_workflow_ref`. The PR-A / PR-B
reusable-workflow architecture was structurally incompatible with that
matching rule: any prerelease publish dispatched via a separate
`prerelease.yml` caller would present a `workflow_ref` that npm's
trusted-publisher records (registered against `publish-release.yml`)
would reject.
The canonical fix used by Storybook, Nx, and Vite is a single-workflow
pattern: one entry-point workflow that branches internally on a `mode`
input. That's what this PR implements.
## What
- **Deletes** `.github/workflows/prerelease.yml`.
- **Refactors** `.github/workflows/publish-release.yml` to handle both
`stable` and `prerelease` modes via `workflow_dispatch` inputs (`mode`,
`suffix`, `dry-run`).
- Adds a `Bump prerelease versions` step in the build job (gated on
`mode == 'prerelease'`) that validates the user-supplied suffix against
`[a-zA-Z0-9._-]+` and falls back to the script's timestamp default when
the suffix input is empty.
- Mode-aware publish script selection (`prerelease.ts` vs
`publish-release.ts`) via env var on the publish step.
- Mode-aware gating on tag creation, GitHub Release creation, Notion
notification, and the release-summary step — all skipped for
prereleases.
- Adds a `Verify publish step emitted version` step that aborts if the
publish script didn't emit a `version` output (would otherwise produce
blank-version summaries and malformed tags/releases).
## Evidence
A dry-run dispatched against this workflow file completed all build +
publish stages successfully (publish step skipped via `dry-run=true`,
summary rendered correctly). The verification canary run `26544606752`
failed against pre-PR-C `main`, confirming that the PR-A/PR-B
architecture cannot pass OIDC and that PR-C is required.
## Code Review
- **Round 1:** 7-agent CR returned 5 consensus Bucket B findings (suffix
validation, version-emission verification, mode-aware tag/release gating
wording, comment cleanups). All applied.
- **Round 2:** 7-agent CR confirmation returned **zero Bucket A
findings**. Two trivial additive nits applied in the final commit: `set
-euo pipefail` on the new verification step for consistency with every
other shell step in the file, and a leading comment on the `Bump
prerelease versions` step explaining the validation logic.
echo "::error::publish step did not emit 'version' output. This indicates the publish-release.ts script (or the configured publish-script input) did not write to GITHUB_OUTPUT. Tag/release creation would produce malformed artifacts; aborting."
253
+
if [ "$MODE" = "prerelease" ]; then
254
+
echo "::error::prerelease.ts did not emit 'version' output to GITHUB_OUTPUT. The Prerelease summary would render a blank Version field; aborting."
255
+
else
256
+
echo "::error::publish-release.ts did not emit 'version' output to GITHUB_OUTPUT. Tag/release creation would produce malformed artifacts; aborting."
0 commit comments