Skip to content

Commit 255c902

Browse files
authored
chore: escape quotation marks in commit messages (#2366)
1 parent 39094de commit 255c902

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: scripts/internal/release-notes.mts

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function repositoryUrl() {
4646
function main(lastRelease: string, nextRelease: string): void {
4747
const args = [
4848
"log",
49-
`--pretty=format:{ "hash": "%H", "message": "%s" }`,
49+
`--pretty=format:{ hash": "%H", "message": "%s" }`,
5050
`${lastRelease}...${nextRelease}`,
5151
];
5252
const git = spawn("git", args, { stdio: ["ignore", "pipe", "inherit"] });
@@ -65,6 +65,8 @@ function main(lastRelease: string, nextRelease: string): void {
6565
const output = Buffer.concat(buffers)
6666
.toString()
6767
.trim()
68+
.replaceAll('"', '\\"')
69+
.replaceAll(""", '"')
6870
.replaceAll("\n", ",");
6971
const commits = JSON.parse(output);
7072
if (commits.length === 0) {

0 commit comments

Comments
 (0)