=== Testing Triple Quote Issue (Issue #135) ===

Original text from CHANGELOG.md:
Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as "already published" when they didn't exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream's .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors.

---

Step 1: Escape double quotes (as in create-github-release.mjs line 77)
After escaping double quotes:
Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as \"already published\" when they didn't exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream's .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors.

---

Step 2: Pass to gh release create with double quotes
Command template: gh release create "tag" --notes "${escapedNotes}"
"'Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as \"already published\" when they didn'\''t exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream'\''s .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors.'"

What the shell receives:
"'Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as \"already published\" when they didn'\''t exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream'\''s .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors.'"


---

Step 3: Simulate GitHub API behavior
When GitHub receives the escaped text from shell, it stores it literally.
So if shell sends: didn'\''t, GitHub stores: didn'\''t
And when rendered, GitHub shows: didn''' (three quotes visible)

---

=== Testing Alternative Approaches ===

Approach 1: Use --input with JSON (avoid shell escaping)
JSON payload:
{"tag_name":"v0.8.45","name":"0.8.45","body":"Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as \"already published\" when they didn't exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream's .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors."}

This approach passes data via stdin as JSON, avoiding shell escaping entirely.

---

Approach 2: Use heredoc
gh release create tag --notes "$(cat <<'EOF'
Fix NPM publish check to properly detect unpublished versions. The script was incorrectly reporting versions as "already published" when they didn't exist on npm, causing the publish step to be skipped. This was caused by misunderstanding how command-stream's .run({ capture: true }) handles command failures - it returns a result object with a code property instead of throwing errors.
EOF
)"

This approach uses heredoc to preserve literal text.

=== Summary ===
The root cause is that command-stream escapes apostrophes when they appear
in double-quoted template literal arguments. The Bash escape sequence for
an apostrophe within single quotes is '\''  which appears as ''' when rendered.

Solution: Use gh API with JSON input instead of gh CLI with shell arguments.
