Skip to content

Commit

Permalink
fix: 슬랙 봇 워크플로우 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jsk3342 committed Nov 14, 2024
1 parent e91ca7e commit 1b999b7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/pr-slack-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,24 @@ jobs:
body='${{ github.event.pull_request.body }}'
# Remove HTML comments and their content
body=$(echo "$body" | sed 's/<!--.*-->//g')
# Remove empty lines and special characters
body=$(echo "$body" | grep -v '^$' | tr -d '\r')
# Replace newlines with actual newlines in Slack message
body=$(echo "$body" | tr '\n' ' ')
# Remove image markdown
body=$(echo "$body" | sed 's/<img[^>]*>//g')
# Remove issue numbers
body=$(echo "$body" | sed 's/#[0-9]*//g')
# Clean up markdown headers and special characters
body=$(echo "$body" | sed 's/##/*/g' | tr -d '\r')
# Escape quotes and backslashes
body="${body//\\/\\\\}"
body="${body//\"/\\\"}"
# Convert newlines to spaces
body=$(echo "$body" | tr '\n' ' ' | sed 's/ */ /g')
echo "body=${body}" >> $GITHUB_OUTPUT
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: >
custom_payload: |
{
"blocks": [
{
Expand Down Expand Up @@ -100,4 +107,4 @@ jobs:
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 1b999b7

Please sign in to comment.