Add option to format releasenotes as markdown (#170)

* feat: allow markdown formatting for gotify
* feat: add option to cli args
* fix: use markdown for missing urls
* fix: do not print curl
* fix: add empty line
* bump template version

---------

Co-authored-by: Tobias Diekel <td@diekel.eu>
This commit is contained in:
Tobias Diekel 2025-05-02 20:08:04 +02:00 committed by GitHub
parent af202c9d6a
commit e393a781cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 9 deletions

View file

@ -1,5 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_GOTIFY_VERSION="v0.1"
NOTIFY_GOTIFY_VERSION="v0.2"
#
# Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up.
@ -12,11 +12,19 @@ trigger_notification() {
GotifyToken="Your Gotify token here"
GotifyUrl="https://api.gotify/message?token=${GotifyToken}"
curl \
-F "title=${MessageTitle}" \
-F "message=${MessageBody}" \
-F "priority=5" \
-X POST "${GotifyUrl}" 1> /dev/null
if [[ "$PrintMarkdownURL" == true ]]; then
ContentType="text/markdown"
else
ContentType="text/plain"
fi
JsonData=$( jq -n \
--arg body "$MessageBody" \
--arg title "$MessageTitle" \
--arg type "$ContentType" \
'{message: $body, title: $title, priority: 5, extras: {"client::display": {"contentType": $type}}}' )
curl -s -S --data "${JsonData}" -H 'Content-Type: application/json' -X POST "${GotifyUrl}" 1> /dev/null
}
send_notification() {