Skip to content

Commit a62d4af

Browse files
committed
Escape newlines in changelog actions
1 parent 743b525 commit a62d4af

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/firebase-hosting-release-nightly.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ jobs:
2828
source: ${{ github.event.release.body }}
2929
find: '## '
3030
replace: ''
31+
- name: Escape nl
32+
uses: mad9000/actions-find-and-replace-string@2
33+
id: findandreplace2
34+
with:
35+
source: ${{ steps.findandreplace.outputs.value }}
36+
find: '\n'
37+
replace: '\\n'
3138
- uses: fjogeleit/http-request-action@v1.11.1
3239
with:
3340
url: ${{ secrets.CHANGELOG_WEBHOOK_URL }}
3441
method: "POST"
3542
customHeaders: '{"Content-Type": "application/json"}'
36-
data: '{"content": "${{ github.event.release.name }}\n\n${{ steps.findandreplace.outputs.value }}\n**Please remember that this is a nightly release and there may still be bugs**", "components": [{"type":1,"components":[{"type":2,"style":5,"label":"Open Stable","url":"https://vocabustudyonline--nightly-q9kbiq6r.web.app/"}]}]}'
43+
data: '{"content": "${{ github.event.release.name }}\n\n${{ steps.findandreplace2.outputs.value }}\n**Please remember that this is a nightly release and there may still be bugs**", "components": [{"type":1,"components":[{"type":2,"style":5,"label":"Open Stable","url":"https://vocabustudyonline--nightly-q9kbiq6r.web.app/"}]}]}'

.github/workflows/firebase-hosting-release-stable.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ jobs:
2828
source: ${{ github.event.release.body }}
2929
find: '## '
3030
replace: ''
31+
- name: Escape nl
32+
uses: mad9000/actions-find-and-replace-string@2
33+
id: findandreplace2
34+
with:
35+
source: ${{ steps.findandreplace.outputs.value }}
36+
find: '\n'
37+
replace: '\\n'
3138
- uses: fjogeleit/http-request-action@v1.11.1
3239
with:
3340
url: ${{ secrets.CHANGELOG_WEBHOOK_URL }}
3441
method: "POST"
3542
customHeaders: '{"Content-Type": "application/json"}'
36-
data: '{"content": "${{ github.event.release.name }}\n\n${{ steps.findandreplace.outputs.value }}", "components": [{"type":1,"components":[{"type":2,"style":5,"label":"Open Stable","url":"https://vocabustudyonline.web.app/"}]}]}'
43+
data: '{"content": "${{ github.event.release.name }}\n\n${{ steps.findandreplace2.outputs.value }}", "components": [{"type":1,"components":[{"type":2,"style":5,"label":"Open Stable","url":"https://vocabustudyonline.web.app/"}]}]}'

0 commit comments

Comments
 (0)