Commit 4dcd8eb 1 parent 3e91b14 commit 4dcd8eb Copy full SHA for 4dcd8eb
File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,34 @@ jobs:
13
13
contents : read
14
14
runs-on : ubuntu-latest
15
15
steps :
16
+ # Preprocess the release body to escape newlines and set as an output variable
17
+ - name : Prepare Release Body
18
+ id : prepare_body
19
+ run : |
20
+ printf "${{ github.event.release.body }}" > changes.txt
21
+ sed -i ':a;N;$!ba;s/\\/\\\\/g; s/"/\\"/g; s/\n/\\n/g; s/\r//g; s/\t/\\t/g' changes.txt
22
+ sed -i -E 's/\(#([0-9]+)\)/([#\1](https:\/\/github.com\/FgForrest\/evitaDB\/issues\/\1))/g' changes.txt
23
+ echo "Contents of the file:"
24
+ cat changes.txt
25
+ echo ""
26
+ sanitized_body=$(< changes.txt)
27
+ echo "processed_body=$sanitized_body" >> $GITHUB_OUTPUT
28
+
29
+ # Send the message to Mattermost with the escaped release body
16
30
- name : Send message to Mattermost
17
31
uses : mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a # v2.0.0
18
32
with :
19
33
MATTERMOST_WEBHOOK_URL : ${{ secrets.MM_WEBHOOK_URL }}
20
34
PAYLOAD : |-
21
35
{
22
- "text": "## 🎉 evitaDB ${{ github.event.release.tag_name }} released!\n\n**Release Notes**:\\n ${{ toJSON(github.event.release.body) }}",
23
- "color":"#31bf2c",
36
+ "attachments": [
37
+ {
38
+ "title": "🎉 evitaDB ${{ github.event.release.name }} released!",
39
+ "title_link": "${{ github.event.release.html_url }}",
40
+ "text": "${{ steps.prepare_body.outputs.processed_body }}",
41
+ "color": "#31bf2c"
42
+ }
43
+ ],
24
44
"username": "${{ github.triggering_actor }}",
25
45
"icon": "https://raw.githubusercontent.com/FgForrest/evitaDB/dev/documentation/assets/img/evita.png"
26
46
}
You can’t perform that action at this time.
0 commit comments