Created
April 25, 2022 10:23
-
-
Save timlianov/22bbe8e16d635f256cd969de7ea84909 to your computer and use it in GitHub Desktop.
telegram multiline message from Jenkins job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat << EOF > str_pre | |
| ❌ ${JOB_NAME} | |
| %0A | |
| %0APR: ${ghprbPullLink} | |
| %0AJOB: ${JOB_URL} | |
| EOF | |
| STR_PRE=$(cat str_pre) | |
| STR=$(echo $STR_PRE | sed 's/\./\\./g; s/\*/\\*/g; s/\[/\\[/g; s/\-/\\-/g;') | |
| curl -X POST https://api.telegram.org/<bot_api_token>/sendMessage -d "chat_id=<chat_id>&text=$STR&disable_web_page_preview=True&parse_mode=MarkdownV2” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment