From 7b5df7df016b0f78ca1265c62c900ecd0ca6eb54 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Fri, 15 Sep 2023 18:58:58 +0300 Subject: [PATCH] Add debugging for notification script (#2840) (#2841) (cherry picked from commit 55fe6ecec99e9fa2cdfd0c077769c8f54c7e8a39) Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> --- .github/workflows/release.yaml | 3 ++- scripts/generate_release_post.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1b2e9f2a1ce..e5c061504ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -217,5 +217,6 @@ jobs: --arg icon_url "https://mattermost.com/wp-content/uploads/2022/02/icon.png" \ --arg username "MattermostRelease" \ --arg text "$(bash -x scripts/generate_release_post.sh $(jq -r .version package.json))" \ - '{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json + '{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json \ + cat /tmp/webhook-data.json curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_RELEASE_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally" diff --git a/scripts/generate_release_post.sh b/scripts/generate_release_post.sh index e5984e77743..390a9519752 100755 --- a/scripts/generate_release_post.sh +++ b/scripts/generate_release_post.sh @@ -5,11 +5,16 @@ VERSION="$1" # such as 5.3.0-rc.1, 5.0.0 TEMP_VERSION_FILE="$(mktemp -t temp_version_file.XXXX)" git for-each-ref --sort=creatordate --format '%(refname)' refs/tags | grep "v[0-9]\.[0-9]\.[0-9]" | grep -v mas | grep -v "v$VERSION" | sed "s/refs\/tags\/v//" > $TEMP_VERSION_FILE -LAST_VERSION="$(cat $TEMP_VERSION_FILE | tail -1)" +# Debugging +cat $TEMP_VERSION_FILE + +LAST_VERSION="$(cat $TEMP_VERSION_FILE | tail -1)" TEMP_CHANGES_FILE="$(mktemp -t temp_changes_file.XXXX)" git cherry -v v$LAST_VERSION v$VERSION | grep ^+ | grep "(#[0-9]\+)" > $TEMP_CHANGES_FILE +cat $TEMP_CHANGES_FILE + cat <<-MD ### [v$VERSION](https://github.com/mattermost/desktop/releases/tag/v$VERSION) :tada: Changes: