Repository navigation
fix(release): don't fail the version step on a stale git exit code - #33
Merged
Merged
Conversation
bump-version.ps1 checks that the new version isn't already tagged with 'git rev-parse --verify refs/tags/vX.Y.Z'. When the tag doesn't exist (the normal case) git exits 1, and that value was left in $LASTEXITCODE. GitHub Actions' pwsh wrapper ends each step with 'exit $LASTEXITCODE', so the "Increment version" step failed right after computing 1.1.10 -> 1.1.11. Nothing was committed or published. - Reset $LASTEXITCODE after the tag lookups in Test-Released. - End bump-version.ps1 and verify-package.ps1 with an explicit exit 0; real failures still surface through 'throw'. Verified under the Actions wrapper (pwsh -command ". '<step>'" plus the appended LASTEXITCODE check): patch bump exits 0, a re-run with an untagged version exits 0 without bumping, a tag collision still exits 1, and package verification exits 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012C6aJYkYBV2GSnSZwsd9GU
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.
Fix: release "Increment version" step fails with exit code 1
After #32 merged,
release.ymlfailed at Increment version right after printingRELEASE_VERSION: 1.1.10 -> 1.1.11 (changed=True).Cause
bump-version.ps1checks that the new version isn't already tagged by runninggit rev-parse --verify refs/tags/v1.1.11. When the tag doesn't exist, which is the normal case, git exits 1, and that value stayed in$LASTEXITCODE. GitHub Actions' pwsh wrapper ends every step withexit $LASTEXITCODE, so a successful bump was reported as a failure.The step failed before the bump was committed, so nothing was pushed, tagged or published.
mainis still at 1.1.10.Fix
$LASTEXITCODEafter the tag lookups.bump-version.ps1andverify-package.ps1with an explicitexit 0. Real errors still fail the step throughthrow.The versioning model is unchanged.
Directory.Build.propsholds the currently published version. On merge tomain, the release reads it, increments it, builds, packs and publishes, and pushes the new value back tomain.Validation
Each case was run the way Actions runs it (
pwsh -command ". '<step>'"plus the appendedexit $LASTEXITCODE):verify-package.ps1on a 1.1.11 packageAfter merge
Merging this PR triggers
release.yml, which should release v1.1.11.🤖 Generated with Claude Code
https://claude.ai/code/session_012C6aJYkYBV2GSnSZwsd9GU