use embeds and add more information for hook

This commit is contained in:
Bella 2020-03-11 10:40:20 -04:00
parent 37861c375f
commit 6fbe1c6a96
No known key found for this signature in database
GPG Key ID: 03B01AC937D1C89C
1 changed files with 5 additions and 2 deletions

View File

@ -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/)"