[CI] 디스코드 알림 제목 포맷 개선 및 review_requested 이벤트 추가#29
Conversation
- 이벤트별 알림 제목을 한국어로 변경했습니다 - GitHub 계정명을 팀원 이름으로 매핑하는 resolve_name 함수를 추가했습니다 - PR·이슈 라벨과 리뷰어를 embed fields로 표시했습니다 - review_requested, ready_for_review 이벤트 핸들링을 추가했습니다
Walkthrough
Changes디스코드 알림 워크플로우
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant SendDetailedDiscordMessage
participant DiscordWebhook
GitHubActions->>SendDetailedDiscordMessage: pull_request / pull_request_review / pull_request_review_comment 이벤트 전달
SendDetailedDiscordMessage->>SendDetailedDiscordMessage: resolve_name / clean_body / build_fields 적용
SendDetailedDiscordMessage->>DiscordWebhook: 임베드 POST 전송
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
📦 번들 사이즈 리포트🕐 Timo Web
빌드 커밋: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/discord-notification.yml:
- Around line 46-47: `COLOR_BLUE` in the Discord notification workflow is mapped
to a magenta value instead of blue, so update the constant used for the PR-open
notification to a real blue and keep the `COLOR_BLUE` label/comment aligned with
its meaning. Verify the color constants in the workflow block that defines
`COLOR_GREEN`, `COLOR_BLUE`, and the other status colors so the notification
styling matches each event consistently.
- Around line 15-17: The discord-notification job is granting unnecessary GitHub
token permissions even though it only reads $GITHUB_EVENT_PATH with jq and posts
to Discord. Update the job’s permissions block in the discord-notification
workflow to use an empty permissions object, or explicitly document any retained
scope with a comment if you decide not to remove it. Use the job-level
permissions section in the discord-notification workflow to locate the change.
- Around line 69-70: The workflow step currently assigns GitHub event values
inside the run script, which should be moved into the step’s env block for
cleaner and safer handling. Update the discord notification job so EVENT_NAME
and ACTION are injected via env using github.event_name and github.event.action,
then reference those shell variables in the script instead of embedding
expressions directly in the run block. Use the existing discord-notification
workflow step context to locate the assignment and keep the script logic
otherwise unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 75157f9d-1432-43ab-a35f-21b789b43a24
📒 Files selected for processing (1)
.github/workflows/discord-notification.yml
- PR·이슈 제목을 description 최상단에 굵게 표시하도록 DESC 구조를 변경했습니다 - 본문 보일러플레이트(헤더, close # 등)를 제거하는 clean_body 함수를 추가했습니다
- EVENT_NAME·ACTION을 env로 이동해 스크립트 인젝션 위험을 제거했습니다 - 불필요한 permissions를 제거했습니다 - 색상 변수명을 의미 기반(COLOR_SUCCESS, COLOR_OPEN 등)으로 변경했습니다
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/discord-notification.yml:
- Around line 55-61: The body-cleaning step in the Discord notification workflow
can exit early when `grep -vE` removes every line under `set -euo pipefail`,
causing `clean_body` to fail instead of returning an empty message. Update the
`clean_body` pipeline in the workflow to treat the “no matching lines” case as
success and return an empty string, so PR bodies containing only template
headers or `close `#123`` still allow the notification job to continue.
- Around line 107-108: `REVIEWER` is only populated from
`.requested_reviewer.login`, so team review requests end up blank in the Discord
notification flow. Update the review-request parsing in the workflow to fall
back to `requested_team.name` (and `slug` if needed) before calling
`resolve_name`, so team-assigned reviewers are surfaced too. Keep the change
localized to the existing `RAW_REVIEWER`/`REVIEWER` extraction logic in the
notification step.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 582c605c-8155-4dee-8125-370c1882aa42
📒 Files selected for processing (1)
.github/workflows/discord-notification.yml
- grep이 매칭 없을 때 set -e로 인해 스크립트가 종료되는 문제를 || true로 수정했습니다 - review_requested 시 팀 리뷰 요청(requested_team)도 처리하도록 추가했습니다
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/discord-notification.yml (1)
57-57: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
|| true를grep단계에만 묶어 주세요.현재는
grep이 한 줄이라도 남기면 뒤의 빈 줄 제거·한 줄 변환·200자 제한이 전부 건너뛰어집니다.grep실패만 정상화하도록 그룹으로 감싸면 의도대로 동작합니다. 참고로 Bash 공식 매뉴얼의 Pipelines/Lists 우선순위도 함께 확인해 주세요.🛠️ 제안 수정
clean_body() { - echo "$1" \ + printf '%s\n' "$1" \ | sed 's/<br>//gi' \ - | grep -vE '^\s*(#|close[sd]? #[0-9]+|fixes? #[0-9]+|resolves? #[0-9]+)' || true \ + | { grep -vE '^\s*(#|close[sd]? #[0-9]+|fixes? #[0-9]+|resolves? #[0-9]+)' || true; } \ | sed '/^\s*$/d' \ | tr '\n' ' ' \ | sed 's/ */ /g' \🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/discord-notification.yml at line 57, Normalize only the grep failure in the Discord notification pipeline by grouping the grep step in the workflow so that || true applies to grep alone, not to the rest of the cleanup chain. Update the pipeline in discord-notification.yml around the grep-vE filter so the subsequent empty-line removal, single-line conversion, and 200-character truncation still run when grep succeeds. Use the existing shell pipeline in this job as the target and preserve the current filtering logic while fixing the operator precedence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In @.github/workflows/discord-notification.yml:
- Line 57: Normalize only the grep failure in the Discord notification pipeline
by grouping the grep step in the workflow so that || true applies to grep alone,
not to the rest of the cleanup chain. Update the pipeline in
discord-notification.yml around the grep-vE filter so the subsequent empty-line
removal, single-line conversion, and 200-character truncation still run when
grep succeeds. Use the existing shell pipeline in this job as the target and
preserve the current filtering logic while fixing the operator precedence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 12530461-3a22-4607-8015-12d97b13e191
📒 Files selected for processing (1)
.github/workflows/discord-notification.yml
kimminna
left a comment
There was a problem hiding this comment.
고생했어요!
바뀐 포맷으로 알림 오면 더 깔끔하고 좋을 것 같아요~~ 😍👍
jjangminii
left a comment
There was a problem hiding this comment.
알림 제목 한국어화부터 팀원 이름 매핑, 보안 개선까지 꼼꼼하게 챙겨주셨네요 👍 디스코드 알림이 훨씬 읽기 편해질 것 같아요!
yumin-kim2
left a comment
There was a problem hiding this comment.
Discord 알림이 더 읽기 쉬워질 것 같아서 설레네요 너무 편리하고 깔끔한 것 같아요! 보안 버그 수정까지...👍👍
수고하셨습니다~~
ISSUE 🔗
close #28
What is this PR? 🔍
디스코드 알림 워크플로우의 메시지 품질을 전반적으로 개선했습니다. 알림 제목을 한국어로 전환하고, GitHub 계정명을 팀원 이름으로 매핑하며, PR·이슈 제목과 라벨·리뷰어 정보를 embed에 노출합니다.
review_requested·ready_for_review이벤트를 추가해 알림 커버리지를 확장했고, 보안 및 안정성 버그도 함께 수정했습니다.배경
[PR],[PR Review]등 영문 prefix로만 표시되고, author가 GitHub ID 그대로 노출되는 구조였습니다.resolve_name함수로 팀원 이름 매핑,review_requested이벤트 추가, 보안·안정성 개선을 순차적으로 진행했습니다.알림 제목 한국어화
[PR] Fix something형태로는 opened·merged·closed를 구분하기 어려웠습니다.ACTION변수 분기를 통해PR이 열렸습니다,PR이 머지됐습니다,리뷰 요청이 왔습니다등 상태별로 제목을 다르게 설정했습니다. review state(approved/changes_requested)도 같은 방식으로 분기했습니다.팀원 이름 매핑
resolve_name함수를 추가했습니다.ehye1,kimminna등 GitHub ID가 그대로 노출돼 가독성이 낮았습니다.case문으로 계정명을 매핑하며, 매핑되지 않은 계정은 원래 ID를 그대로 반환합니다. avatar 이미지 URL은 원본 GitHub ID를 유지합니다.본문 포맷 개선
clean_body함수를 추가했습니다.close #28같은 boilerplate가 그대로 노출됐습니다.clean_body가<br>, 헤더(#),close/fix/resolve #숫자패턴, 빈 줄을 제거한 뒤 200자로 자릅니다. DESC는**$PR_TITLE**\n$CLEAN_BODY형태로 구성합니다.라벨·리뷰어 fields 표시
review_requested시 리뷰어를 embed fields로 표시했습니다.build_fields함수가 labels, reviewer 문자열을 받아 fields JSON 배열을 동적으로 구성합니다. 값이 비어 있으면 해당 field는 추가하지 않습니다. 팀 리뷰 요청(requested_team)도 처리합니다.review_requested 이벤트 추가
pull_request.types에review_requested,ready_for_review를 추가하고 핸들링 로직을 구현했습니다.review_requested시requested_reviewer.login을 파싱해resolve_name으로 변환 후 리뷰어 field로 노출합니다. 개인이 아닌 팀 리뷰 요청은requested_team.name으로 fallback합니다.보안·안정성 개선
EVENT_NAME·ACTION을env로 이동하고,grep오류 방지를 추가했습니다.${{ github.event_name }}을 shell 스크립트에 직접 인라인하면 스크립트 인젝션 위험이 있습니다. 또한grep이 매칭 없을 때 exit code 1을 반환해set -e환경에서 스크립트가 조기 종료되는 문제가 있었습니다.env:블록으로 주입하고 shell에서 환경변수로 참조합니다.grep파이프라인 끝에|| true를 추가해 매칭 없는 경우도 정상 처리합니다.To Reviewers
ready_for_review이벤트는 Draft → 리뷰 준비 완료 전환 시 발생하며, 현재는 PR이 열렸을 때와 동일한 색상을 사용하고 있습니다.Screenshot 📷
Test Checklist ✔
review_requested이벤트 실제 발송 확인requested_team.name노출 확인