Skip to content

fix(release): match changelog replacement prefixes literally - #1763

Open
John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
fix/changelog-replace-prefix
Open

John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
fix/changelog-replace-prefix

Conversation

@jdalton

Copy link
Copy Markdown
Contributor

Dependency bumps can still rewrite their existing Unreleased note in place. Switch the release helper from a command-line regex to a literal --replace-prefix and update the Coana and socket-patch examples. This removes the regex injection flagged by CodeQL alert #14.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped change to internal release/changelog automation with tests; no runtime auth or data-path behavior.

Overview
Replaces the release helper’s --replace regex flag with --replace-prefix, so dependency-bump automation rewrites an existing Unreleased bullet by literal string prefix instead of compiling user-supplied regex (addresses CodeQL regex-injection risk).

add-unreleased.mts and changelog.mts now find the first bullet in the target section whose text starts with the prefix; blank prefixes are rejected. Coana and socket-patch skill docs and unit tests are updated accordingly, including coverage that prefixes with punctuation (e.g. [cli]) match literally, not as regex.

Reviewed by Cursor Bugbot for commit 36c2bc6. Configure here.

throw new Error(
`[add-unreleased] unknown flag ${arg}.\n` +
' Known: --file, --replace, --section.',
' Known: --file, --replace-prefix, --section.',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[agent] Coana’s publish workflow checks out v1.x and still passes --replace, which this parser rejects. Once this lands, a release that needs a Socket CLI bump will fail before opening the PR. Can we make the workflow handle both flag versions before merging, or temporarily accept the exact legacy Coana argument as a literal prefix?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants