Skip to content

fix: stricter version matching and workspace root detection#79

Merged
Slokh merged 1 commit intomasterfrom
fix/version-matching-and-workspace-detection
Mar 18, 2026
Merged

fix: stricter version matching and workspace root detection#79
Slokh merged 1 commit intomasterfrom
fix/version-matching-and-workspace-detection

Conversation

@Slokh
Copy link
Contributor

@Slokh Slokh commented Mar 18, 2026

Summary

Two bug fixes found during code review of the unified workspace versioning changes (PRs #76 and #78):

1. action.yml — partial version string matching (high severity)

index($0, ver) performs a substring match, so version 1.0 would match ## 1.0.1 or ## 11.0.0, causing incorrect changelog extraction for GitHub Releases.

Fix: Use an anchored regex $0 ~ "^## " ver "[ (]" that requires the version to appear right after ## and be followed by a space or (.

2. rust.rs — fragile workspace root detection (medium severity)

content.contains("[workspace]") could false-match comments or string values like features = ["workspace"].

Fix: Parse the TOML properly with toml_edit and check doc.get("workspace").is_some().

Testing

  • cargo test --lib -- rust — 16/16 passed
  • cargo check — clean

…tion

- action.yml: Replace index($0, ver) substring match with regex
  anchored match to prevent partial version collisions (e.g., '1.0'
  matching '1.0.1')
- rust.rs: Use toml_edit parsing instead of string contains to detect
  workspace root, preventing false matches from comments or strings

Amp-Thread-ID: https://ampcode.com/threads/T-019d0268-a225-76d0-951a-b0991bcdda1f
Co-authored-by: Amp <amp@ampcode.com>
@github-actions
Copy link
Contributor

⚠️ Changelog not found.

A changelog entry is required before merging. We've generated a suggested changelog based on your changes:

Preview
---
changelogs: patch
---

Fixed stricter version heading matching in `action.yml` to avoid false positives (e.g. `1.0` matching `1.0.1`), and improved workspace root detection in the Rust ecosystem to use proper TOML parsing instead of string search.

Add changelog to commit this to your branch.

@Slokh Slokh merged commit 810f56d into master Mar 18, 2026
3 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