summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-03-04 14:57:22 +0800
committerraveit65 <[email protected]>2019-03-10 15:18:21 +0100
commit99439e0207c318df0ba4095b7e65ff69accfff63 (patch)
tree41d76198f859da0833416e5d40881dafcde4fb07
parenta081fbe66264869a9b84f20c6f32be3468c4c99b (diff)
downloadmarco-99439e0207c318df0ba4095b7e65ff69accfff63.tar.bz2
marco-99439e0207c318df0ba4095b7e65ff69accfff63.tar.xz
[ci] Use status notification
-rw-r--r--.travis.yml11
1 files changed, 8 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index b50b5cb3..3b66e0e5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,9 +37,14 @@ deploy:
after_success:
- 'if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" && ${DISTRO} =~ ^fedora.*$ ]]; then
- COMMENT="[Notification]: Clang Analyzer results of $TRAVIS_COMMIT at https://mate-desktop.github.io/${TRAVIS_REPO_SLUG#*/}/";
- curl -H "Authorization: token $GITHUB_TOKEN" -X POST -d "{\"body\": \"$COMMENT\"}" "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments" >/dev/null;
- fi'
+ REPO_SLUG_ARRAY=(${TRAVIS_REPO_SLUG//\// });
+ REPO_NAME=${REPO_SLUG_ARRAY[1]};
+ URL="https://${REPO_NAME}.mate-desktop.dev";
+ COMMENT="Code analysis completed";
+ curl -H "Authorization: token $GITHUB_TOKEN" -X POST
+ -d "{\"state\": \"success\", \"description\": \"$COMMENT\", \"context\":\"scan-build\", \"target_url\": \"$URL\"}"
+ https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA};
+ fi'
env:
- DISTRO="archlinux/base"