#!/bin/sh # # Automatically generates a message for a new release of webhook with some useful # links and embedded release notes. # # Usage: # ./release-message.sh # # Example: # ./release-message.sh "v0.5.2-rc.3" "v0.5.2-rc.4" PREV_WEBHOOK_VERSION=$1 # e.g. v0.5.2-rc.3 NEW_WEBHOOK_VERSION=$2 # e.g. v0.5.2-rc.4 GITHUB_TRIGGERING_ACTOR=${GITHUB_TRIGGERING_ACTOR:-} usage() { cat < EOF } if [ -z "$PREV_WEBHOOK_VERSION" ] || [ -z "$NEW_WEBHOOK_VERSION" ]; then usage exit 1 fi set -ue # XXX: That's wasteful but doing it by caching the response in a var was giving # me unicode error. url=$(gh release view --repo rancher/webhook --json url "${NEW_WEBHOOK_VERSION}" --jq '.url') body=$(gh release view --repo rancher/webhook --json body "${NEW_WEBHOOK_VERSION}" --jq '.body') generated_by="" if [ -n "$GITHUB_TRIGGERING_ACTOR" ]; then generated_by=$(cat <