From 768586e1078cb45455571d70d3122c109616f525 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Fri, 20 Jan 2023 15:28:23 +0400 Subject: [PATCH] message --- gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitlab-ci.yml b/gitlab-ci.yml index a218880..ea1f9d6 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -17,12 +17,13 @@ stages: name: $CURL_IMAGE entrypoint: ["/usr/bin/env", "sh", "-c"] script: | - test -n "${CI_COMMIT_TAG}" && NOTIFICATION_REVISION=${CI_COMMIT_TAG} || NOTIFICATION_REVISION=${CI_COMMIT_SHA} + NOTIFICATION_REVISION="${CI_COMMIT_SHA}" + test -z "${CI_COMMIT_TAG}" || NOTIFICATION_REVISION="$(echo ${CI_COMMIT_TAG} | sed -e 's/\./\\\\./g')" curl \ -X POST \ -H "Content-Type: application/json" \ - -d "{\"chat_id\": \"${TELEGRAM_RECEPIENT}\", \"parse_mode\": \"html\", \"text\": \"${NOTIFICATION_ICON} ${CI_PROJECT_TITLE}
CI/CD pipeline run ${NOTIFICATION_TYPE}
- revision: \"}" \ - https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage + -d "{\"chat_id\": \"${TELEGRAM_RECEPIENT}\", \"parse_mode\": \"MarkdownV2\", \"disable_web_page_preview\": \"true\", \"text\": \"${NOTIFICATION_ICON} [*${CI_PROJECT_TITLE}*](${CI_PROJECT_URL})\nCI/CD pipeline run [*${NOTIFICATION_TYPE}*](${CI_PIPELINE_URL})\n\\\\- *revision*: ${NOTIFICATION_REVISION}\"}" \ + "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" cache: [] dependencies: [] interruptible: false -- GitLab