Skip to content

Commit 99dac26

Browse files
committed
utils: add helper to send matrix messages through maubot
See coreos/coreos-ci#55
1 parent d6b5f05 commit 99dac26

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

utils.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,4 +706,22 @@ def get_supported_additional_arches() {
706706
return supported
707707
}
708708

709+
// try sending a message on matrix through maubot
710+
def matrixSend(message) {
711+
712+
withCredentials([usernamePassword(credentialsId: 'matrix-bot-webhook-token',
713+
usernameVariable: 'URL',
714+
passwordVariable: 'TOKEN')]) {
715+
716+
shwrap("""
717+
curl -X POST -H "Content-Type: application/json" \
718+
-u $TOKEN $URL \
719+
-d '
720+
{
721+
"body": "$message"
722+
}'
723+
""")
724+
}
725+
}
726+
709727
return this

0 commit comments

Comments
 (0)