Repository navigation
fix(ci): add fallback publish for semantic-release git-notes bug - #257
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
🎉 This PR is included in version 2.9.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This branch was successfully deployed
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.
Description
Adds a fallback to the Release workflow for a known, unfixed upstream semantic-release bug (semantic-release/semantic-release#1762): semantic-release unconditionally pushes a git-notes ref (
refs/notes/semantic-release-*) as part of its core release flow, before it ever calls the npm/GitHub publish steps. When that push fails - as it did on the one release run this workflow has completed so far (run38067588114, 2026-10-10) - the version bump, build, commit, and tag have already landed, but the actual npm publish and GitHub release never run. There is no plugin option or flag to disable the notes push; it is unconditional core behavior. This repo only ever releases from a single branch (main), so the multi-channel tracking the notes exist for isn't needed here.Github Issue: None - found while manually triggering a release, not tracked by a filed issue.
Changes
.github/workflows/release.yml:registry-url: https://registry.npmjs.orgto theSetup Node.jsstep, so a directnpm publishlater in the job can authenticate viaNODE_AUTH_TOKEN.Releasestep now hasid: releaseandcontinue-on-error: true, and pipes its output (withset -o pipefailso the step's exit code still reflects the real command, nottee) torelease-output.log.Detect known git-notes push failurestep that only runs ifReleasefailed. It grepsrelease-output.logforrefs/notes/semantic-release; if found, it sets an output flag and lets the job continue. If the failure doesn't match that pattern, it exits non-zero so the job still fails normally for any other reason.Fallback publishstep that only runs when that flag is set. It reads the version semantic-release already wrote topackages/package.json, then runsnpm publishandgh release create --generate-notesdirectly.How Has This Been Tested?
workflow_dispatchworkflow isn't unit-testable.npx @action-validator/cli(passed). The fallback logic was traced against the actual failure output captured from the one realReleasestep failure this workflow has produced so far (run38067588114, 2026-10-10), confirming the grep pattern matches that output and thatpackages/package.json's version is already updated by the point the fallback would run. The fallback steps themselves have not been exercised by an actual workflow run - there is no way to verifynpm publishandgh release createsucceed in this exact CI context without actually triggering a release.Checklist
Reviewer Guidance
gh workflow run release.ymland watch the run. If theReleasestep fails again on the known git-notes issue, confirm theDetect known git-notes push failureandFallback publishsteps both run and succeed, and that the new version actually appears on the npm registry (npm view arm-js-library version) and as a GitHub release.Releaseshows a failure for the known git-notes reason, the overall job and workflow run complete successfully (green), with the new version published to npm and a GitHub release created.Releasefails for a reason other than the git-notes push, theDetect known git-notes push failurestep deliberately exits non-zero and the fallback does not run - the whole job will show as failed, which is intentional so a real failure is never silently papered over.