Skip to content

Commit

Permalink
Wrap PR and discussion titles in toJSON to escape them in Slack
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound committed Jan 24, 2024
1 parent 8e21893 commit e9b3de6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/discussion_ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
env:
discussion_url: ${{ github.event.discussion.html_url }}
discussion_number: ${{ github.event.discussion.number }}
discussion_title: ${{ github.event.discussion.title }}
discussion_title: ${{ toJSON(github.event.discussion.title) }}
discussion_author: ${{ github.event.discussion.user.login }}
discussion_repo: ${{ github.event.repository.full_name }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
env:
pr_url: ${{ github.event.pull_request.html_url }}
pr_number: ${{ github.event.pull_request.number }}
pr_title: ${{ github.event.pull_request.title }}
pr_title: ${{ toJSON(github.event.pull_request.title) }}
pr_author: ${{ github.event.pull_request.user.login }}
pr_repo: ${{ github.event.pull_request.base.repo.full_name }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -33,7 +33,7 @@ jobs:
with:
payload: |
{
"text": "New ${{ env.pr_status }} PR opened by ${{ env.pr_author }} in ${{ env.pr_repo }}: #${{ env.pr_number }} - ${{ env.pr_title }}",
"text": "New${{ env.pr_status }}PR opened by ${{ env.pr_author }} in ${{ env.pr_repo }}: #${{ env.pr_number }} - ${{ env.pr_title }}",
"blocks": [
{
"type": "section",
Expand Down

0 comments on commit e9b3de6

Please sign in to comment.