Skip to content

sent-dm-typescript: fix JSON escaping in publish-npm workflow_dispatch branch#54

Merged
arbianst merged 1 commit into
mainfrom
fix-publish-npm-workflow-dispatch-json-escape
May 14, 2026
Merged

sent-dm-typescript: fix JSON escaping in publish-npm workflow_dispatch branch#54
arbianst merged 1 commit into
mainfrom
fix-publish-npm-workflow-dispatch-json-escape

Conversation

@arbianst
Copy link
Copy Markdown
Contributor

Summary

  • One-character escaping fix in .github/workflows/publish-npm.yml: the workflow_dispatch branch now produces the same backslash-escaped quotes the release-triggered branch already uses, so the outer { "paths_released": "$PATHS_RELEASED" } argument remains valid JSON after bash expansion.
  • Before this fix, manually re-running the workflow with a path input produced { "paths_released": "["packages/mcp-server"]" } (unescaped inner quotes) and JSON.parse blew up at position 23 in scripts/publish-packages.ts before npm publish was ever called. Most recent occurrence: run 25872276660.

Why this matters now

@sentdm/sentdm@0.27.2 shipped to npm via OIDC trusted publishing on the release-triggered run. @sentdm/sentdm-mcp@0.27.2 failed because trusted publishing wasn't configured on the npm side yet. That's been fixed, but the workflow_dispatch path to retry the MCP publish is itself broken — this PR unblocks it. Same template-bug-workaround pattern as the PHP packagist URL, TS MCP manifest formatting, and Java byte-buddy (sentdm/sent-dm-java#32) fixes.

Test plan

  • After merge, run gh workflow run publish-npm.yml --repo sentdm/sent-dm-typescript -f path=packages/mcp-server and confirm @sentdm/sentdm-mcp@0.27.2 lands on npm.

…h branch

The release-triggered branch builds `PATHS_RELEASED` with literal-backslash-
escaped quotes so the array survives being embedded inside the outer
`{ "paths_released": "$PATHS_RELEASED" }` JSON string. The
`workflow_dispatch` branch was double-quoted with un-escaped `\"`, which
collapses to bare `"` after bash expansion and produces invalid JSON like
`{ "paths_released": "["packages/mcp-server"]" }` — `JSON.parse` then
fails at position 23 before `npm publish` ever runs.

Matching the escaping pattern from the else branch unblocks manual
re-publishes (e.g. when `@sentdm/sentdm-mcp` needs to be republished
after trusted-publisher setup on npm).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arbianst arbianst enabled auto-merge May 14, 2026 16:45
@arbianst arbianst disabled auto-merge May 14, 2026 16:45
@arbianst arbianst enabled auto-merge May 14, 2026 16:45
@arbianst arbianst merged commit fc5bdf7 into main May 14, 2026
7 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