Skip to content

Commit 2b73cb3

Browse files
committed
Escape double quotes from changelog
If we don't, the resulting JSON for GH API call is broken.
1 parent fde1f6f commit 2b73cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/release-notes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
ConvertFrom-Json |
4343
select -ExpandProperty id
4444
45-
$notes = (Get-Content .\changelog.md | where { !($_ -like '\*') } | %{ $_.replace('\', '\\') }) -join '\n'
45+
$notes = (Get-Content .\changelog.md | where { !($_ -like '\*') } | %{ $_.replace('\', '\\').replace('"', '\"') }) -join '\n'
4646
$headers = @{ 'Accept'='application/vnd.github.v3+json;charset=utf-8'; 'Authorization' = "bearer $env:GITHUB_TOKEN" }
4747
$body = '{ "body":"' + $notes + '" }'
4848
@@ -53,4 +53,4 @@ jobs:
5353
iwr -Body $body "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/releases/$id" -Method PATCH -Headers $headers |
5454
select -ExpandProperty Content |
5555
ConvertFrom-Json |
56-
ConvertTo-Json
56+
ConvertTo-Json

0 commit comments

Comments
 (0)