From 5067e265e2df98b49df6db55a613966e7f093c52 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Mon, 30 Jun 2025 17:04:30 +0200 Subject: [PATCH 1/2] ci: sanitize github PR name for slack notification <&test> --- .github/workflows/ci-notify-slack.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-notify-slack.yml b/.github/workflows/ci-notify-slack.yml index eb0d466e..462d832d 100644 --- a/.github/workflows/ci-notify-slack.yml +++ b/.github/workflows/ci-notify-slack.yml @@ -12,10 +12,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - name: Sanitize PR title + id: sanitize + run: | + RAW_TITLE="${{ github.event.pull_request.title }}" + ESCAPED_TITLE=$(echo "$RAW_TITLE" \ + | sed 's/&/\&/g' \ + | sed 's//\>/g') + echo "safe_title=$ESCAPED_TITLE" >> "$GITHUB_OUTPUT" + - name: Post to a Slack channel - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + uses: slackapi/slack-github-action@v1 with: channel-id: eng-execution-mrs - slack-message: ":github: `${{ github.repository }}` <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" + slack-message: ":github: `${{ github.repository }}` <${{ github.event.pull_request.html_url }}|${{ steps.sanitize.outputs.safe_title }}>" env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_API_TOKEN }} From 3dff39b6dbd61a2c557026682830da4bb07f6ea2 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Mon, 30 Jun 2025 17:05:18 +0200 Subject: [PATCH 2/2] . --- .github/workflows/ci-notify-slack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-notify-slack.yml b/.github/workflows/ci-notify-slack.yml index 462d832d..6746111c 100644 --- a/.github/workflows/ci-notify-slack.yml +++ b/.github/workflows/ci-notify-slack.yml @@ -24,7 +24,7 @@ jobs: echo "safe_title=$ESCAPED_TITLE" >> "$GITHUB_OUTPUT" - name: Post to a Slack channel - uses: slackapi/slack-github-action@v1 + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 with: channel-id: eng-execution-mrs slack-message: ":github: `${{ github.repository }}` <${{ github.event.pull_request.html_url }}|${{ steps.sanitize.outputs.safe_title }}>"