diff options
author | mid-kid <esteve.varela@gmail.com> | 2019-01-01 12:05:34 +0100 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2019-01-01 12:13:54 +0100 |
commit | f04f31ea852a36ea94c94bfa9ccaa70a7dfec421 (patch) | |
tree | 58e06d09b1677d240a88f7c4f99acd5198a4993b | |
parent | 9fde0912c3d2e4255f43508118590c7c43cc71f2 (diff) |
Add travis webhook for unnamed.py
(still requires setup)
-rw-r--r-- | .travis.yml | 2 | ||||
-rwxr-xr-x | .travis/webhook.sh | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index ab3908bb4..ce3402ecf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,5 @@ before_script: script: - make -j2 compare - check_status +after_success: + - .travis/webhook.sh diff --git a/.travis/webhook.sh b/.travis/webhook.sh new file mode 100755 index 000000000..032e2231a --- /dev/null +++ b/.travis/webhook.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Only run this script if it's the master branch build. +[ "$TRAVIS_BRANCH" != 'master' -o "$TRAVIS_PULL_REQUEST" != 'false' ] && exit + +root="$(realpath "$(dirname "$0")/..")" +content="" + +# Report unnamed symbols +content+="$("$root/tools/unnamed.py" -r "$root" "$root/pokecrystal.sym" | grep -v -e '^lib/mobile/' -e '^mobile/' | head)" + +curl -H 'Content-Type: application/json' -X POST "$POKECRYSTAL_DISCORD_WEBHOOK_URL" -d@- << EOF +{ + "username": "$POKECRYSTAL_DISCORD_WEBHOOK_USERNAME", + "avatar_url": "$POKECRYSTAL_DISCORD_WEBHOOK_AVATAR_URL", + "content": "\`\`\`$(echo "$content" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')\`\`\`" +} +EOF |