Skip to content

Commit c67407e

Browse files
KyleAMathewsclaude
andauthored
Fix missing data in release comments (#3583)
The release notification comments were missing package data because backticks in the body text (e.g., `@electric-sql/client@1.2.8`) were being interpreted by the shell as command substitution. This caused the package names to be replaced with empty strings. Fix by using gh's --body-file - flag to pass the body via stdin, avoiding shell interpretation entirely. Fixes comments like #3547 (comment) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 46ecf6d commit c67407e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

scripts/comment-on-release.mjs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ Thanks for contributing to Electric!`
198198
return
199199
}
200200

201-
execSync(
202-
`gh pr comment ${prNumber} --repo ${REPO} --body "${body.replace(/"/g, '\\"')}"`,
203-
{ stdio: 'inherit' }
204-
)
201+
// Use --body-file with stdin to avoid shell interpretation of backticks
202+
execSync(`gh pr comment ${prNumber} --repo ${REPO} --body-file -`, {
203+
input: body,
204+
encoding: 'utf8',
205+
stdio: ['pipe', 'inherit', 'inherit'],
206+
})
205207
console.log(` Commented on PR #${prNumber}`)
206208
} catch (e) {
207209
console.error(` Failed to comment on PR #${prNumber}:`, e.message)
@@ -270,10 +272,12 @@ Thanks for reporting!`
270272
return
271273
}
272274

273-
execSync(
274-
`gh issue comment ${issueNumber} --repo ${REPO} --body "${body.replace(/"/g, '\\"')}"`,
275-
{ stdio: 'inherit' }
276-
)
275+
// Use --body-file with stdin to avoid shell interpretation of backticks
276+
execSync(`gh issue comment ${issueNumber} --repo ${REPO} --body-file -`, {
277+
input: body,
278+
encoding: 'utf8',
279+
stdio: ['pipe', 'inherit', 'inherit'],
280+
})
277281
console.log(` Commented on issue #${issueNumber}`)
278282
} catch (e) {
279283
console.error(` Failed to comment on issue #${issueNumber}:`, e.message)

0 commit comments

Comments
 (0)