From 0e4f23eddaef1000f7925b1dade0a5d85bb2e44e Mon Sep 17 00:00:00 2001 From: Bella Date: Mon, 27 Apr 2020 12:28:30 -0400 Subject: [PATCH] remove travis from hook.sh and use git --- scripts/hook.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/hook.sh b/scripts/hook.sh index 5f35b40ad..40a96f644 100755 --- a/scripts/hook.sh +++ b/scripts/hook.sh @@ -1,13 +1,12 @@ #!/bin/bash -if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then exit 0; else echo "">/dev/null; fi - CUR_VER="$(tail -c +2 ./scripts/curVer)" -COMMIT_TRIM="${TRAVIS_COMMIT::7}" -COMMIT_MSG="$TRAVIS_COMMIT_MESSAGE" +COMMIT_TRIM="$(git log --format=%h -1)" +COMMIT_FULL="$(git log --format=%H -1)" +COMMIT_MSG="$(git log --format=%s -1)" # Send message with branch name -#curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","color": 10195199,"description": "**Changelog:** '"$COMMIT_MSG"'\nBranch: `'"$BRANCH"'`\nCommit: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commits/'${COMMIT_TRIM}') Direct: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commit/'${TRAVIS_COMMIT}') "}]}' "$WEBHOOK" +curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","color": 10195199,"description": "**Changelog:** '"$COMMIT_MSG"'\nBranch: `'"$BRANCH"'`\nCommit: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commits/'${COMMIT_TRIM}') Direct: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commit/'${COMMIT_FULL}') "}]}' "$WEBHOOK" # Find the release file and rename it to kamiblue-version-commit-release.jar BUILD_DIR="$(readlink -f ./build/libs/)"