Fix release action: update_version.sh corrupts dependency versions on release - #12
Merged
Conversation
…rrences Co-authored-by: insane66613 <8126035+insane66613@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix the release action
Fix release action: update_version.sh corrupts dependency versions on release
Mar 12, 2026
insane66613
marked this pull request as ready for review
March 12, 2026 23:53
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.
update_version.shperformed a blind global string replacement of the package's own version value across the entirepackage.json, inadvertently corrupting dependency version strings where the version appeared as a substring.Example of the bug (releasing
v0.6.4withpages/contentat version0.4.2):"autoprefixer": "^10.4.20"→"autoprefixer": "^10.6.40"(non-existent version)pnpm install --no-frozen-lockfileto fail withERR_PNPM_NO_MATCHING_VERSIONPriority*
Purpose of the PR*
Fix the release GitHub Action, which was failing due to
update_version.shcorrupting dependency version specifiers inpackage.jsonfiles during the version-bump step.Changes*
bash-scripts/update_version.sh: Replace the naive full-file string substitution with a targeted regex anchored to the"version"JSON key only.The new pattern captures
"version": "as group 1 and replaces only the bare version value, leaving dependency version specifiers untouched regardless of substring overlap.How to check the feature
Trigger the release workflow (via
workflow_dispatch) with a tag where the package version (e.g.,0.4.2) is a substring of any dependency version string (e.g.,^10.4.20). The install step should complete withoutERR_PNPM_NO_MATCHING_VERSION.Reference
v0.6.4release dispatch corruptedautoprefixer@^10.4.20→^10.6.40inpages/content/package.jsonbecause0.4.2⊂10.4.20.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.