Problem
MATCH_PACKAGE_VERSION regex in src/parsePatch.ts (line ~9) uses "? to optionally strip double quotes around YAML keys, but pnpm's default output (and most YAML formatters) uses single quotes for scoped package names. This causes the captured package name to include the single quotes (e.g. '@commercetools/nimbus' instead of @commercetools/nimbus), producing a mangled lookup key that doesn't match the catalog map built by calculateCatalogUpdates.ts (which correctly parses YAML and produces clean keys).
Result
For any pnpm-workspace.yaml catalog entry with a single-quoted key (all scoped @org/pkg names by default), the action logs "No package.json files were updated" and writes no changeset, even though the catalog resolution and named-catalog support in calculateCatalogUpdates.ts works correctly.
Reproduction
Any monorepo using pnpm catalogs (named or default) with scoped packages. The diff line + '@commercetools/nimbus': 3.5.1 produces packageId = "'@commercetools/nimbus'@3.5.1" instead of "@commercetools/nimbus@3.5.1", so catalog[packageId] returns undefined.
Note
The action's own test fixtures in parsePatch.test.ts use double quotes for catalog entries, which is why the bug isn't caught by the existing test suite.
Suggested Fix
Change the regex from:
const MATCH_PACKAGE_VERSION = /^\+\s*"?([^\s]+?)"?:\s+"?([^\s]+?)"?$/u;
to:
const MATCH_PACKAGE_VERSION = /^\+\s*['"]?([^\s]+?)['"]?:\s+['"]?([^\s]+?)['"]?$/u;
Also add a test case with single-quoted scoped package names.
Version
v1.2.5 (SHA 874dac2372a085cb94f750e8bdf5b1173a838a75)
Problem
MATCH_PACKAGE_VERSIONregex insrc/parsePatch.ts(line ~9) uses"?to optionally strip double quotes around YAML keys, but pnpm's default output (and most YAML formatters) uses single quotes for scoped package names. This causes the captured package name to include the single quotes (e.g.'@commercetools/nimbus'instead of@commercetools/nimbus), producing a mangled lookup key that doesn't match the catalog map built bycalculateCatalogUpdates.ts(which correctly parses YAML and produces clean keys).Result
For any
pnpm-workspace.yamlcatalog entry with a single-quoted key (all scoped@org/pkgnames by default), the action logs "No package.json files were updated" and writes no changeset, even though the catalog resolution and named-catalog support incalculateCatalogUpdates.tsworks correctly.Reproduction
Any monorepo using pnpm catalogs (named or default) with scoped packages. The diff line
+ '@commercetools/nimbus': 3.5.1producespackageId = "'@commercetools/nimbus'@3.5.1"instead of"@commercetools/nimbus@3.5.1", socatalog[packageId]returnsundefined.Note
The action's own test fixtures in
parsePatch.test.tsuse double quotes for catalog entries, which is why the bug isn't caught by the existing test suite.Suggested Fix
Change the regex from:
to:
Also add a test case with single-quoted scoped package names.
Version
v1.2.5 (SHA
874dac2372a085cb94f750e8bdf5b1173a838a75)