Skip to content

Commit

Permalink
ci: fix escape special characters in Discord notification description
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Jan 11, 2025
1 parent 21a393b commit 78a0c54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/actions/notification/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ runs:
COLOR=9868950
fi
DESCRIPTION="${{ inputs.DESCRIPTION }}"
DESCRIPTION="${DESCRIPTION//\"/\\\"}"
DESCRIPTION="${DESCRIPTION//$'\n'/'\\n'}"
PAYLOAD=$(cat <<EOF
{
"avatar_url": "https://raw.githubusercontent.com/daodaoedu/daodao-f2e/main/public/daodao-logo.webp",
Expand All @@ -53,7 +57,7 @@ runs:
"icon_url": "${{ inputs.AUTHOR_ICON_URL }}"
},
"title": "${{ inputs.TITLE }}",
"description": "${{ inputs.DESCRIPTION }}",
"description": $DESCRIPTION,
"color": $COLOR
}
]
Expand Down

0 comments on commit 78a0c54

Please sign in to comment.