From 8523260a8124e03718e81d5325e6762bdc5b7e63 Mon Sep 17 00:00:00 2001 From: Hugo Richard Date: Sat, 17 Oct 2026 16:11:58 +0100 Subject: [PATCH] ci(release): rewrite release notes when one package fails to publish --- .github/workflows/release.yml | 6 ++++-- AGENTS.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 788096ec..f5339ee0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,14 +48,16 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true + # changesets sets `published` before it exits on a failed package, so these steps still + # run for the packages that did reach npm. The job stays failed either way. - name: Push tags - if: steps.changesets.outputs.published == 'true' + if: ${{ !cancelled() && steps.changesets.outputs.published == 'true' }} run: git push --tags # Rebuilds each release body from that package's PRs and changesets, then moves Latest # back to evlog. The header of scripts/release-notes/index.mjs says why. - name: Rewrite release notes and mark evlog Latest - if: steps.changesets.outputs.published == 'true' + if: ${{ !cancelled() && steps.changesets.outputs.published == 'true' }} run: node scripts/release-notes/index.mjs '${{ steps.changesets.outputs.publishedPackages }}' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/AGENTS.md b/AGENTS.md index 4e059602..abae19d0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ pnpm content:lint:test # the scanner's own tests, including its two pnpm release-notes:test # tests for scripts/release-notes, which rewrites GitHub release bodies and pins Latest to evlog ``` -Publishing is automated: changesets + `.github/workflows/release.yml`. Never run `pnpm release` or `changeset publish` manually. +Publishing is automated: changesets + `.github/workflows/release.yml`. Never run `pnpm release` or `changeset publish` manually. CI publishes with npm Trusted Publishing, so a new package needs GitHub Actions (`evloghq/evlog`, `release.yml`) added as its Trusted Publisher on npmjs.com before the first release that includes it; without it npm answers `E404` on the publish. > Use `corepack enable` once so the `packageManager` field in `package.json` pins the right pnpm version automatically. >