Conversation
This workflow notifies a Discord channel on pull request events such as opened, reopened, closed (merged), and closed (not merged). It includes details about the PR and the changes made.
Removed 'Changes' field from PR notifications and updated color code.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough.new 워크플로우 파일 .github/workflows/pr-notifier.yml을 추가합니다. 이 워크플로우는 main, develop, release 브랜치의 pull_request 이벤트(opened, reopened, closed)에서 트리거되며, 이벤트 유형과 병합 여부에 따라 Discord 웹훅으로 조건부 알림을 전송합니다. 알림은 PR 작성자, 제목, 번호, URL 및 head→base 브랜치 정보를 포함하고 이벤트별로 다른 임베드 색상을 사용합니다. Possibly related issues
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Added a field name to PR notification messages.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/pr-notifier.yml (1)
24-122: 4개 알림 스텝이 거의 동일하므로 단일 스텝으로 합치면 유지보수가 쉬워집니다.현재는 제목/색상/조건만 다르고 본문 구조가 동일해서, 추후 필드 변경 시 누락 위험이 큽니다. 공통 payload + 이벤트별 매핑으로 단일화하는 리팩터링을 권장합니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-notifier.yml around lines 24 - 122, Consolidate the four near-identical steps ("Notify Discord - PR Opened", "Notify Discord - PR Reopened", "Notify Discord - PR Closed (Merged)", "Notify Discord - PR Closed (Not merged)") into a single step that still uses Ilshidur/action-discord@0.3.2 and a single DISCORD_EMBEDS payload; compute the title and color dynamically from github.event.action and github.event.pull_request.merged (use the existing expressions like github.event.pull_request.title, number, html_url, head_ref, base_ref and user.login/avatar_url) and set a single if: that triggers for the PR actions you care about (e.g., github.event.action in [opened,reopened,closed]); implement a small mapping inside the workflow (via env or run step) that selects the proper title prefix ("[PR Opened]","[PR Reopened]","[PR Merged]","[PR Closed]") and color values before populating DISCORD_EMBEDS so the payload structure is shared and only the title/color vary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-notifier.yml:
- Around line 36-37: Escape or JSON-encode the PR title before inserting into
the DISCORD_EMBEDS JSON to prevent broken JSON when the title contains quotes or
newlines: replace direct uses of github.event.pull_request.title in the "title"
fields (the lines with "title": "[PR Opened] ${{ github.event.pull_request.title
}} (...)" and the analogous Reopened/Merged/Closed steps) with a
safe-escaped/value-rendered version (e.g., using toJson / fromJson or workflow
expression that JSON-encodes the string) so the embedded JSON remains valid;
apply the same change to every occurrence of the "title" insertion (also check
the matching "title" lines for Reopened, Merged, and Closed steps) and ensure
the "url" and other fields remain unchanged.
- Line 26: 현재 워크플로에서 사용 중인 Ilshidur/action-discord@0.3.2 같은 mutable 태그는 공급망 위험이
있으니, 모든 사용처의 액션 참조(예: "Ilshidur/action-discord@0.3.2")를 해당 리포지토리의 특정 커밋 SHA로
고정하세요; GitHub에서 해당 릴리스/태그의 커밋 SHA를 조회한 뒤 "Ilshidur/action-discord@<COMMIT_SHA>"
형태로 교체하고 같은 변경을 워크플로 내의 모든 사용 위치(현재 4곳)에서 적용하세요.
- Around line 19-21: The Discord webhook secret may be empty for forked
pull_request events causing the Discord action to fail; update the workflow step
conditions that currently reference DISCORD_WEBHOOK /
secrets.PR_DISCORD_WEBHOOK_URL (the environment variable DISCORD_WEBHOOK and the
steps that send Discord messages) to also check that env.DISCORD_WEBHOOK != ''
so the steps are skipped when the webhook is not present; ensure all relevant
steps (those setting DISCORD_WEBHOOK, DISCORD_USERNAME, DISCORD_AVATAR and the
Discord notify steps) include the additional condition (e.g., add &&
env.DISCORD_WEBHOOK != '' to their if expressions).
---
Nitpick comments:
In @.github/workflows/pr-notifier.yml:
- Around line 24-122: Consolidate the four near-identical steps ("Notify Discord
- PR Opened", "Notify Discord - PR Reopened", "Notify Discord - PR Closed
(Merged)", "Notify Discord - PR Closed (Not merged)") into a single step that
still uses Ilshidur/action-discord@0.3.2 and a single DISCORD_EMBEDS payload;
compute the title and color dynamically from github.event.action and
github.event.pull_request.merged (use the existing expressions like
github.event.pull_request.title, number, html_url, head_ref, base_ref and
user.login/avatar_url) and set a single if: that triggers for the PR actions you
care about (e.g., github.event.action in [opened,reopened,closed]); implement a
small mapping inside the workflow (via env or run step) that selects the proper
title prefix ("[PR Opened]","[PR Reopened]","[PR Merged]","[PR Closed]") and
color values before populating DISCORD_EMBEDS so the payload structure is shared
and only the title/color vary.
📌 작업 내용
Pull Request 이벤트에 대한 Discord 자동 알림 워크플로우 추가
(PR 생성, 재개, 병합, 종료 상태별로 상세 정보와 함께 알림)
🧩 관련 이슈
📸 스크린샷
Summary by CodeRabbit