Skip to content

Commit b9de95d

Browse files
committed
fix the webhook limit
1 parent 9af713e commit b9de95d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflow_scripts/announce_discord.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ CHANGELOG_CONTENT=$("$SCRIPT_DIR/get-latest-changelog.sh")
3939
CHANGELOG_CONTENT=$(echo "$CHANGELOG_CONTENT" | jq -Rs .)
4040
CHANGELOG_CONTENT=${CHANGELOG_CONTENT#\"} # Remove leading quote
4141
CHANGELOG_CONTENT=${CHANGELOG_CONTENT%\"} # Remove trailing quote
42-
echo "Changelog content: $CHANGELOG_CONTENT"
42+
43+
# Check if changelog content is longer than 4096 characters
44+
if [ ${#CHANGELOG_CONTENT} -gt 4096 ]; then
45+
CHANGELOG_CONTENT="${CHANGELOG_CONTENT:0:3900}..."
46+
CHANGELOG_CONTENT+=$"\nFor the complete changelog, visit: https://github.com/Parallels/terraform-provider-parallels-desktop/releases/tag/v${VERSION}"
47+
fi
4348

4449
# Create the JSON payload
4550
JSON_PAYLOAD=$(
@@ -55,7 +60,7 @@ EOF
5560
)
5661
echo "$JSON_PAYLOAD"
5762

58-
Send the webhook request
63+
# Send the webhook request
5964
curl -H "Content-Type: application/json" \
6065
-d "$JSON_PAYLOAD" \
6166
"$WEBHOOK_URL"

0 commit comments

Comments
 (0)