CI: Make alert_pending_release.sh filter substrate changes based on github labels... (#850)

* CI: Split common functions into lib.sh and make...

... alert_pending_release.sh check the substrate changes for various
labels. If labelled, will be included in the changelog, otherwise will
silently be left out.

* replace non-standard /bin/bash with /usr/bin/env bash

* CI: make lib.sh /bin/sh-compatible
This commit is contained in:
s3krit
2020-02-18 15:59:22 +01:00
committed by GitHub
parent e3a3d05350
commit 25e2448597
3 changed files with 111 additions and 66 deletions
@@ -1,19 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
# structure_message $content $formatted_content (optional)
structure_message() {
if [ -z "$2" ]; then
body=$(jq -Rs --arg body "$1" '{"msgtype": "m.text", $body}' < /dev/null)
else
body=$(jq -Rs --arg body "$1" --arg formatted_body "$2" '{"msgtype": "m.text", $body, "format": "org.matrix.custom.html", $formatted_body}' < /dev/null)
fi
echo "$body"
}
# send_message $body (json formatted) $room_id $access_token
send_message() {
curl -XPOST -d "$1" "https://matrix.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3"
}
#shellcheck source=lib.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/lib.sh"
# Receive keys
# trusted_keys=(