From 74beda88633019d77000116f00d1917f411dc333 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Wed, 3 Dec 2025 14:04:04 -0700 Subject: [PATCH] style(discord): add line break between title and details --- .github/workflows/discord.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/discord.yaml b/.github/workflows/discord.yaml index c15253b7..0ce2f610 100644 --- a/.github/workflows/discord.yaml +++ b/.github/workflows/discord.yaml @@ -46,7 +46,7 @@ jobs: [ ${#PR_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." [ -n "$BODY" ] && BODY=" ยท $BODY" - MSG="$ICON **[$LABEL #$PR_NUM: $PR_TITLE](<$PR_URL>)** by @$PR_USER$BODY" + MSG=$(printf '%s **[%s #%s: %s](<%s>)**\nby @%s%s' "$ICON" "$LABEL" "$PR_NUM" "$PR_TITLE" "$PR_URL" "$PR_USER" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # Issue events @@ -72,7 +72,7 @@ jobs: [ ${#ISSUE_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." [ -n "$BODY" ] && BODY=" ยท $BODY" - MSG="$ICON **[$LABEL #$ISSUE_NUM: $ISSUE_TITLE](<$ISSUE_URL>)** by @$ISSUE_USER$BODY" + MSG=$(printf '%s **[%s #%s: %s](<%s>)**\nby @%s%s' "$ICON" "$LABEL" "$ISSUE_NUM" "$ISSUE_TITLE" "$ISSUE_URL" "$ISSUE_USER" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # Issue comment @@ -95,7 +95,7 @@ jobs: BODY=$(echo "$COMMENT_BODY" | tr '\n\r' ' ' | head -c $MAX_BODY_LENGTH) [ ${#COMMENT_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." - MSG="๐Ÿ’ฌ **[Comment on $TYPE #$ISSUE_NUM: $ISSUE_TITLE](<$COMMENT_URL>)** @$COMMENT_USER: $BODY" + MSG=$(printf '๐Ÿ’ฌ **[Comment on %s #%s: %s](<%s>)**\n@%s: %s' "$TYPE" "$ISSUE_NUM" "$ISSUE_TITLE" "$COMMENT_URL" "$COMMENT_USER" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # PR Review @@ -121,7 +121,7 @@ jobs: [ ${#REVIEW_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." [ -n "$BODY" ] && BODY=": $BODY" - MSG="$ICON **[$LABEL PR #$PR_NUM: $PR_TITLE](<$REVIEW_URL>)** @$REVIEW_USER$BODY" + MSG=$(printf '%s **[%s PR #%s: %s](<%s>)**\n@%s%s' "$ICON" "$LABEL" "$PR_NUM" "$PR_TITLE" "$REVIEW_URL" "$REVIEW_USER" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # PR Review comment @@ -141,7 +141,7 @@ jobs: BODY=$(echo "$COMMENT_BODY" | tr '\n\r' ' ' | head -c $MAX_BODY_LENGTH) [ ${#COMMENT_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." - MSG="๐Ÿ’ญ **[Review Comment PR #$PR_NUM: $PR_TITLE](<$COMMENT_URL>)** @$COMMENT_USER: $BODY" + MSG=$(printf '๐Ÿ’ญ **[Review Comment PR #%s: %s](<%s>)**\n@%s: %s' "$PR_NUM" "$PR_TITLE" "$COMMENT_URL" "$COMMENT_USER" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # Release @@ -161,7 +161,7 @@ jobs: [ ${#RELEASE_BODY} -gt $MAX_BODY_LENGTH ] && BODY="${BODY}..." [ -n "$BODY" ] && BODY=" ยท $BODY" - MSG="๐Ÿš€ **[Release $TAG: $NAME](<$URL>)**$BODY" + MSG=$(printf '๐Ÿš€ **[Release %s: %s](<%s>)**\n%s' "$TAG" "$NAME" "$URL" "$BODY") jq -n --arg content "$MSG" '{content: $content}' | curl -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- # Branch/tag created