diff --git a/.github/workflows/telegram-bot.yml b/.github/workflows/telegram-bot.yml index fa3e59e8..8b2c8108 100644 --- a/.github/workflows/telegram-bot.yml +++ b/.github/workflows/telegram-bot.yml @@ -41,31 +41,31 @@ jobs: if [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "opened" ]]; then ESCAPED_NAME=`echo -e "$PR_NAME" | sed 's/\&/\&/g' | sed 's//\>/g'` - TEXT=`echo -e "$PR_AUTHOR created new PR#$PR_NUMBER '$ESCAPED_NAME' to branch '$PR_BASE'"` + TEXT=`echo -e ""$PR_AUTHOR" created new PR#"$PR_NUMBER" '"$ESCAPED_NAME"' to branch '"$PR_BASE"'"` elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "synchronize" ]]; then - TEXT=`echo -e "$PR_AUTHOR updated PR#$PR_NUMBER"` + TEXT=`echo -e ""$PR_AUTHOR" updated PR#"$PR_NUMBER""` elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then - TEXT=`echo -e "$PR_MERGED merged PR#$PR_NUMBER to branch '$PR_BASE'"` + TEXT=`echo -e ""$PR_MERGED" merged PR#"$PR_NUMBER" to branch '"$PR_BASE"'"` elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "closed" ]]; then - TEXT=`echo -e "$PR_AUTHOR closed PR#$PR_NUMBER"` + TEXT=`echo -e ""$PR_AUTHOR" closed PR#"$PR_NUMBER""` elif [[ ! -z "${{ github.event.comment }}" ]]; then ESCAPED_TEXT=`echo -e "$COMMENT_BODY"| sed 's/\&/\&/g' | sed 's//\>/g'` if [[ ! -z "${{ github.event.pull_request }}" ]]; then - TEXT=`echo -e "$COMMENT_AUTHOR posted the following comment to file $COMMENT_FILE in PR#$PR_NUMBER:\n$ESCAPED_TEXT"` + TEXT=`echo -e ""$COMMENT_AUTHOR" posted the following comment to file "$COMMENT_FILE" in PR#"$PR_NUMBER":\n"$ESCAPED_TEXT""` else - TEXT=`echo -e "$COMMENT_AUTHOR posted the following comment to issue #$COMMENT_NUMBER:\n$ESCAPED_TEXT"` + TEXT=`echo -e ""$COMMENT_AUTHOR" posted the following comment to issue #"$COMMENT_NUMBER":\n"$ESCAPED_TEXT""` fi elif [[ ! -z "${{ github.event.review }}" && "$REVIEW_STATE" == "changes_requested" ]]; then - TEXT=`echo -e "$REVIEW_AUTHOR requested changes for PR#$PR_NUMBER"` + TEXT=`echo -e ""$REVIEW_AUTHOR" requested changes for PR#"$PR_NUMBER""` elif [[ ! -z "${{ github.event.review }}" && "$REVIEW_STATE" == "commented" && ! -z "$REVIEW_COMMENT" ]]; then ESCAPED_TEXT=`echo -e "$REVIEW_COMMENT"| sed 's/\&/\&/g' | sed 's//\>/g'` - TEXT=`echo -e "$REVIEW_AUTHOR posted the following comment to PR#$PR_NUMBER:\n$ESCAPED_TEXT"` + TEXT=`echo -e ""$REVIEW_AUTHOR" posted the following comment to PR#"$PR_NUMBER":\n"$ESCAPED_TEXT""` elif [[ ! -z "${{ github.event.review }}" && "$REVIEW_STATE" != "commented" ]]; then - TEXT=`echo -e "$REVIEW_AUTHOR $REVIEW_STATE PR#$PR_NUMBER"` + TEXT=`echo -e ""$REVIEW_AUTHOR" "$REVIEW_STATE" PR#"$PR_NUMBER""` elif [[ -z "${{ github.event.review }}" && "${{ github.event.action }}" == "submitted" ]]; then - TEXT=`echo -e "Due to GitHub Actions bug we cannot identify, who approved PR#$PR_NUMBER"` + TEXT=`echo -e "Due to GitHub Actions bug we cannot identify, who approved PR#"$PR_NUMBER""` elif [[ ! -z "${{ github.event.workflow_run }}" && "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then ESCAPED_TEXT=`echo -e "$UNIVERSUM_BRANCH"| sed 's/\&/\&/g' | sed 's//\>/g'` @@ -75,9 +75,9 @@ jobs: TEXT=`echo -e "Universum run for branch "$ESCAPED_TEXT" FAILED; commit "$ESCAPED_TEXT" "` fi - if [[ ! -z $TEXT ]]; then + if [[ ! -z "$TEXT" ]]; then curl --get --data-urlencode "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --data-urlencode "disable_web_page_preview=True" \ - --data-urlencode "text=$TEXT" --data-urlencode "parse_mode=HTML" $URL + --data-urlencode "text="$TEXT"" --data-urlencode "parse_mode=HTML" "$URL" fi env: