From af451907c987a0ba6ca7c8ba9cf7996ba8272d2a Mon Sep 17 00:00:00 2001 From: Lee Hye Won Date: Sat, 27 Jun 2026 01:13:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(root):=20=EB=94=94=EC=8A=A4=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=95=8C=EB=A6=BC=20=EB=B3=B8=EB=AC=B8=20=EA=B8=B8?= =?UTF-8?q?=EC=9D=B4=20=EC=A0=9C=ED=95=9C=20=EB=8B=A8=EC=9D=BC=ED=99=94=20?= =?UTF-8?q?=EB=B0=8F=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC=20(#33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clean_body의 200자 제한 제거 후 DESC 400자 단일 제한으로 통일, 불필요한 DESC 초기 할당 dead code 제거, 주석 수정을 반영했습니다. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/discord-notification.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/discord-notification.yml b/.github/workflows/discord-notification.yml index 8e1c9077..88a6d813 100644 --- a/.github/workflows/discord-notification.yml +++ b/.github/workflows/discord-notification.yml @@ -50,15 +50,13 @@ jobs: COLOR_COMMENT=9807270 # PR 코멘트 COLOR_ISSUE=7275516 # 이슈 - # PR/이슈 본문에서 보일러플레이트 제거 후 첫 150자 반환 + # PR/이슈 본문에서 보일러플레이트 제거 후 반환 (DESC에서 400자로 제한) clean_body() { echo "$1" \ | sed 's/
//gi' \ - | grep -vE '^\s*(#|close[sd]? #[0-9]+|fixes? #[0-9]+|resolves? #[0-9]+)' || true \ - | sed '/^\s*$/d' \ + | { grep -vE '^\s*(#|close[sd]? #[0-9]+|fixes? #[0-9]+|resolves? #[0-9]+)' || true; } \ | tr '\n' ' ' \ - | sed 's/ */ /g' \ - | cut -c1-200 + | sed 's/ */ /g' } # 라벨·리뷰어를 받아 fields JSON 배열 반환 @@ -80,7 +78,6 @@ jobs: if [ "$EVENT_NAME" = "pull_request" ]; then PR_TITLE="$(jq -r '.pull_request.title // ""' "$GITHUB_EVENT_PATH")" URL="$(jq -r '.pull_request.html_url // ""' "$GITHUB_EVENT_PATH")" - DESC="$(jq -r '.pull_request.body // "내용 없음"' "$GITHUB_EVENT_PATH")" RAW_AUTHOR="$(jq -r '.pull_request.user.login // ""' "$GITHUB_EVENT_PATH")" AUTHOR="$(resolve_name "$RAW_AUTHOR")" LABELS="$(jq -r '[.pull_request.labels[].name] | join(", ")' "$GITHUB_EVENT_PATH")" @@ -119,7 +116,8 @@ jobs: exit 0 fi - DESC="**$PR_TITLE**\n$CLEAN_BODY" + DESC="**${PR_TITLE}**"$'\n'"${CLEAN_BODY}" + DESC="${DESC:0:400}" FIELDS="$(build_fields "$LABELS" "$REVIEWER")" elif [ "$EVENT_NAME" = "pull_request_review" ]; then @@ -132,7 +130,6 @@ jobs: AUTHOR="$(resolve_name "$RAW_AUTHOR")" PR_TITLE="$(jq -r '.pull_request.title // ""' "$GITHUB_EVENT_PATH")" URL="$(jq -r '.pull_request.html_url // ""' "$GITHUB_EVENT_PATH")" - DESC="$(jq -r '.review.body // "내용 없음"' "$GITHUB_EVENT_PATH")" REVIEW_STATE="$(jq -r '.review.state // ""' "$GITHUB_EVENT_PATH")" LABELS="$(jq -r '[.pull_request.labels[].name] | join(", ")' "$GITHUB_EVENT_PATH")" @@ -149,7 +146,8 @@ jobs: RAW_BODY="$(jq -r '.review.body // ""' "$GITHUB_EVENT_PATH")" CLEAN_BODY="$(clean_body "$RAW_BODY")" - DESC="**$PR_TITLE**\n$CLEAN_BODY" + DESC="**${PR_TITLE}**"$'\n'"${CLEAN_BODY}" + DESC="${DESC:0:400}" FIELDS="$(build_fields "$LABELS" "")" elif [ "$EVENT_NAME" = "pull_request_review_comment" ]; then @@ -165,7 +163,8 @@ jobs: URL="$(jq -r '.comment.html_url // ""' "$GITHUB_EVENT_PATH")" RAW_BODY="$(jq -r '.comment.body // ""' "$GITHUB_EVENT_PATH")" CLEAN_BODY="$(clean_body "$RAW_BODY")" - DESC="**$PR_TITLE**\n$CLEAN_BODY" + DESC="**${PR_TITLE}**"$'\n'"${CLEAN_BODY}" + DESC="${DESC:0:400}" COLOR=$COLOR_COMMENT FIELDS='[]' @@ -177,7 +176,8 @@ jobs: URL="$(jq -r '.issue.html_url // ""' "$GITHUB_EVENT_PATH")" RAW_BODY="$(jq -r '.issue.body // ""' "$GITHUB_EVENT_PATH")" CLEAN_BODY="$(clean_body "$RAW_BODY")" - DESC="**$ISSUE_TITLE**\n$CLEAN_BODY" + DESC="**${ISSUE_TITLE}**"$'\n'"${CLEAN_BODY}" + DESC="${DESC:0:400}" COLOR=$COLOR_ISSUE LABELS="$(jq -r '[.issue.labels[].name] | join(", ")' "$GITHUB_EVENT_PATH")" FIELDS="$(build_fields "$LABELS" "")"