From 99439e0207c318df0ba4095b7e65ff69accfff63 Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Mon, 4 Mar 2019 14:57:22 +0800 Subject: [ci] Use status notification --- .travis.yml | 11 ++++++++--- 1 file 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" -- cgit v1.2.1