File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,21 @@ jobs:
12
12
steps :
13
13
- name : Checkout
14
14
uses : actions/checkout@v4
15
+
16
+ - name : Sanitize PR title
17
+ id : sanitize
18
+ run : |
19
+ RAW_TITLE="${{ github.event.pull_request.title }}"
20
+ ESCAPED_TITLE=$(echo "$RAW_TITLE" \
21
+ | sed 's/&/\&/g' \
22
+ | sed 's/</\</g' \
23
+ | sed 's/>/\>/g')
24
+ echo "safe_title=$ESCAPED_TITLE" >> "$GITHUB_OUTPUT"
25
+
15
26
- name : Post to a Slack channel
16
27
uses : slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
17
28
with :
18
29
channel-id : eng-execution-mrs
19
- slack-message : " :github: `${{ github.repository }}` <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>"
30
+ slack-message : " :github: `${{ github.repository }}` <${{ github.event.pull_request.html_url }}|${{ steps.sanitize.outputs.safe_title }}>"
20
31
env :
21
32
SLACK_BOT_TOKEN : ${{ secrets.SLACK_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments