From cb8f016a1729e7946600da1b1f9869704c347b70 Mon Sep 17 00:00:00 2001
From: Roman Abdulmanov <roman@metabase.com>
Date: Mon, 12 Jun 2023 18:15:50 +0400
Subject: [PATCH] Fix Slack notification issue with quotes in the title
 (#31504)

---
 .github/workflows/escalation-slack-notification.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/escalation-slack-notification.yml b/.github/workflows/escalation-slack-notification.yml
index 3b8375afe8f..fd4ae776082 100644
--- a/.github/workflows/escalation-slack-notification.yml
+++ b/.github/workflows/escalation-slack-notification.yml
@@ -10,6 +10,12 @@ jobs:
     runs-on: ubuntu-22.04
     timeout-minutes: 10
     steps:
+      - name: Format issue title (escape quotes)
+        uses: actions/github-script@v6
+        id: vars
+        with:
+          script: |
+            core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
       - name: Send escalated issue ${{ github.event.issue.number }} to Slack
         id: slack
         uses: slackapi/slack-github-action@v1.23.0
@@ -21,7 +27,7 @@ jobs:
                   "type": "section",
                   "text": {
                     "type": "mrkdwn",
-                    "text": "🔥🔥🔥 ${{ github.event.issue.title }}\n${{ github.event.issue.html_url }}"
+                    "text": "🔥🔥🔥 ${{ steps.vars.outputs.issue_title }}\n${{ github.event.issue.html_url }}"
                   }
                 }
               ]
-- 
GitLab