Skip to content

fix(release): anchor aft version pattern in bump config#10

Merged
lewisjared merged 3 commits into
mainfrom
fix/bumpversion-substring-match
May 12, 2026
Merged

fix(release): anchor aft version pattern in bump config#10
lewisjared merged 3 commits into
mainfrom
fix/bumpversion-substring-match

Conversation

@lewisjared

Copy link
Copy Markdown
Contributor

Summary

  • The Bump version workflow (run Add Helm chart version bumping config #2) failed with Did not find 'chart-version = "0.1.0"' in file: 'versions.toml'.
  • Root cause: the aft [[tool.bumpversion.files]] entry used the search string version = "{current_version}", which is a substring of chart-version = "0.1.0". bump-my-version rewrote both lines in step 2, so step 3 had nothing left to match and aborted with exit 2.
  • Fix: anchor the aft entry with regex = true and ^version = "{current_version}" so it only touches the [aft] line. The chart-version entry remains responsible for its own replacement.

Test plan

  • uv run bump-my-version bump --dry-run --verbose --allow-dirty minor – all four file rewrites succeed (pyproject.toml, versions.toml [aft], versions.toml chart-version, helm/Chart.yaml).
  • Re-run the Bump version workflow on main after this merges and confirm it goes green.

The `version = "{current_version}"` search pattern matched the
`chart-version` line as a substring, so the second files entry rewrote
both lines in versions.toml.
The third files entry then failed with "Did not find
'chart-version = \"0.1.0\"'" and aborted the release workflow.

Switch the aft version entry to a regex anchored on `^version` so it
only touches the `[aft]` line, leaving the `chart-version` entry to do
its own replacement.
@lewisjared lewisjared merged commit 567946e into main May 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant