Skip to content

Commit

Permalink
Add debugging for notification script (#2840) (#2841)
Browse files Browse the repository at this point in the history
(cherry picked from commit 55fe6ec)

Co-authored-by: Devin Binnie <[email protected]>
  • Loading branch information
mattermost-build and devinbinnie authored Sep 15, 2023
1 parent 658a8ca commit 7b5df7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 6 additions & 1 deletion scripts/generate_release_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7b5df7d

Please sign in to comment.