Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

circleci: Put the branch name into the topic on failure.

Alex Vandivercbede2d3fcdd
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 16a23d3f79e..2081b02338d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -172,8 +172,9 @@ aliases:
only: master
command: |
if [[ "$CIRCLE_REPOSITORY_URL" == "[email protected]:zulip/zulip.git" && "$ZULIP_BOT_KEY" != "" ]]; then
+ URI_ESCAPED_TOPIC="$(python3 -c 'import sys; import urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$CIRCLE_BRANCH failing")"
curl -H "Content-Type: application/json" \
- -X POST -i 'https://chat.zulip.org/api/v1/external/circleci?api_key='"$ZULIP_BOT_KEY"'&stream=automated%20testing&topic=master%20failing' \
+ -X POST -i 'https://chat.zulip.org/api/v1/external/circleci?api_key='"$ZULIP_BOT_KEY"'&stream=automated%20testing&topic='"$URI_ESCAPED_TOPIC" \
-d '{"payload": { "branch": "'"$CIRCLE_BRANCH"'", "reponame": "'"$CIRCLE_PROJECT_REPONAME"'", "status": "failed", "build_url": "'"$CIRCLE_BUILD_URL"'", "username": "'"$CIRCLE_USERNAME"'"}}'
fi