diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-06-13 19:45:15 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-06-13 19:47:51 -0400 |
commit | e83467525bf1ffa4e16a44a8e8729380e77ec92a (patch) | |
tree | 7716ea963f1196b717c38535eb2e30f20af9ab85 /.github/calcrom/webhook.sh | |
parent | 099279a65aae4519a3941a47116e16924149ac4f (diff) |
Migrate to github workflows and output symfiles
Diffstat (limited to '.github/calcrom/webhook.sh')
-rwxr-xr-x | .github/calcrom/webhook.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.github/calcrom/webhook.sh b/.github/calcrom/webhook.sh new file mode 100755 index 000000000..86da74c87 --- /dev/null +++ b/.github/calcrom/webhook.sh @@ -0,0 +1,16 @@ +#!/bin/bash -ex + +# Only run this script if it's the master branch build. +if [[ "$TRAVIS_BRANCH" != "master" || "$TRAVIS_PULL_REQUEST" != "false" ]]; then + exit 0 +fi + +build_name=$1 +map_file=$build_name.map +if [ ! -f $map_file ]; then + echo "$map_file does not exist!" + exit 1 +fi + +output=$(perl $(dirname "$0")/calcrom.pl $build_name.map | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g') +curl -d "{\"username\": \"$CALCROM_DISCORD_WEBHOOK_USERNAME\", \"avatar_url\": \"$CALCROM_DISCORD_WEBHOOK_AVATAR_URL\", \"content\":\"\`\`\`$build_name progress:\\n$output\`\`\`\"}" -H "Content-Type: application/json" -X POST $CALCROM_DISCORD_WEBHOOK_URL |