From 6fbe1c6a96b59f2e9409a2be1719471590f18391 Mon Sep 17 00:00:00 2001 From: Bella Date: Wed, 11 Mar 2020 10:40:20 -0400 Subject: [PATCH] use embeds and add more information for hook --- scripts/hook.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/hook.sh b/scripts/hook.sh index d5b899ce..e1d374cd 100755 --- a/scripts/hook.sh +++ b/scripts/hook.sh @@ -2,9 +2,12 @@ if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then exit 0; else echo "">/dev/null; fi +COMMIT_TRIM="${TRAVIS_COMMIT::7}" +COMMIT_MSG="$TRAVIS_COMMIT_MESSAGE" + if [[ "$BRANCH" == "feature/master" ]]; then # Send message with branch name - curl -H "Content-Type: application/json" -X POST -d '{"username": "KAMI Blue Releases", "content": "**Branch:** `'$BRANCH'`"}' "$WEBHOOK" + curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","description": "**Changelog:** '"$COMMIT_MSG"'\nBranch: `'"$BRANCH"'`\nCommit: ['${COMMIT_TRIM}'](https://github.com/S-B99/kamiblue/commits/'${COMMIT_TRIM}')"}]}' "$WEBHOOK" # Upload the release file BUILD_DIR="$(readlink -f ./build/libs/)" @@ -12,7 +15,7 @@ if [[ "$BRANCH" == "feature/master" ]]; then curl -F content=@"$BUILD_DIR/$JAR_DIR" "$WEBHOOK" elif [[ "$BRANCH" == "feature/safecrystal#480" ]]; then # Send message with branch name - curl -H "Content-Type: application/json" -X POST -d '{"username": "KAMI Blue Releases", "content": "**Branch:** `'$BRANCH'`"}' "$WEBHOOK" + curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","description": "**Changelog:** '"$COMMIT_MSG"'\nBranch: `'"$BRANCH"'`\nCommit: ['${COMMIT_TRIM}'](https://github.com/S-B99/kamiblue/commits/'${COMMIT_TRIM}')"}]}' "$WEBHOOK" # Upload the release file BUILD_DIR="$(readlink -f ./build/libs/)"