Repository navigation
ci(release): use GITHUB_TOKEN and npm trusted publishing on release/rc - #345
Merged
Merged
Conversation
The semantic-release step failed on every push to release/rc since the default branch was renamed: the release config still listed "master" as the release branch, so semantic-release found no release branch at all (ERELEASEBRANCHES), and the workflow authenticated with the stale GH_TOKEN secret (401 Bad credentials). As a result 5.0.0-rc.21 was never published after the sort fix was merged. Bring the rc line in line with main: - release.branches: "master" -> "main" - semantic-release ^19 -> ^25, whose npm plugin publishes via OIDC trusted publishing (id-token: write) instead of NPM_TOKEN - workflow: checkout@v4 + setup-node@v4 pinned by .nvmrc (Node 22), built-in GITHUB_TOKEN with explicit permissions, github-pages-deploy v4 into the gh-pages/rc folder, and gate deploy + release on release/rc so feature-branch pushes no longer run them - regenerate package-lock.json for the new semantic-release tree; the Angular, Storybook and lint dependency versions are unchanged Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHoGUgdEaYbnkn84rpkGHw
|
🎉 This PR is included in version 5.0.0-rc.21 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
semantic-releasestep that failed on therelease/rcpush after #344 was merged (CI run 129), so5.0.0-rc.21was never published. The same step had been failing on every push to this branch; it is also why run 127 on the #344 fix branch was red.Two independent causes, both stale config relative to
main:ERELEASEBRANCHES– "Your configuration for the problematic branches is []".release.branchesinpackage.jsonstill namedmasteras the release branch. That branch no longer exists (the default branch ismain), so semantic-release had zero release branches after filtering against the remote and refused to run.401 Bad credentialsfrom@semantic-release/github. The workflow authenticated with theGH_TOKENrepository secret, which is no longer valid.mainstopped using it in favour of the built-inGITHUB_TOKENplus OIDC trusted publishing to npm (noNPM_TOKEN), which is how 5.1.2 was published.Changes
Brings the rc line in line with
main's release setup; no library code is touched.package.json:release.branches"master"→"main";semantic-release^19.0.5→^25.0.3(its npm plugin publishes via OIDC and bundles npm 11).package-lock.json: regenerated for the new semantic-release tree. Angular 15.1.x, CLI, ng-packagr, TypeScript 4.9.4, Storybook 6.5.15, webpack 5.75, eslint and prettier pins are unchanged..nvmrc:22, used bysetup-node(the branch already builds on Node 22 in CI)..github/workflows/main.yml:checkout@v4+setup-node@v4, explicitpermissions(contents,issues,pull-requests,id-token: write),GITHUB_TOKENinstead ofGH_TOKEN/NPM_TOKEN,github-pages-deploy-action@v4deploying Storybook into thegh-pages/rcfolder (the foldermain's deploy preserves viaclean-exclude), and the deploy + release steps gated onrefs/heads/release/rcso feature-branch pushes only build. Removed the deprecatedset-outputbranch step and therelease-info-actionstep, which were unused.Verification
npm ci --legacy-peer-depsfrom a clean tree installs the new lockfile;npm run buildandnpm run build-storybookpass.semantic-release --dry-run --no-cion the fix branch resolves the branch config (4.x, 5.x, main, release/rc) and exits 0 instead of throwingERELEASEBRANCHES.The same dry run on a local branch named
release/rcat this commit (commit-analyzer + release-notes plugins only, nothing pushed or published) reports:Release
Merging this PR triggers the workflow on
release/rc, which should publish5.0.0-rc.21(the sort fix from #344) to the npmrcdist-tag and create the GitHub release. If npm's trusted publisher for@angular-generic-table/coreis restricted to a GitHub environment, the publish step will say so and the job needs thatenvironment:added.🤖 Generated with Claude Code
https://claude.ai/code/session_01QHoGUgdEaYbnkn84rpkGHw
Generated by Claude Code