Skip to content

PR Discord Webhook 연동#70

Open
moondev03 wants to merge 6 commits intodevelopfrom
feat/#68-pr-discord-webhook
Open

PR Discord Webhook 연동#70
moondev03 wants to merge 6 commits intodevelopfrom
feat/#68-pr-discord-webhook

Conversation

@moondev03
Copy link
Member

@moondev03 moondev03 commented Feb 25, 2026

📌 작업 내용

Pull Request 이벤트에 대한 Discord 자동 알림 워크플로우 추가
(PR 생성, 재개, 병합, 종료 상태별로 상세 정보와 함께 알림)

🧩 관련 이슈


📸 스크린샷

image

Summary by CodeRabbit

  • Chores
    • Pull Request 이벤트에 대한 Discord 자동 알림 워크플로우 추가 — PR 생성, 재개, 병합, 비병합 종료 등 이벤트별로 PR 작성자, 제목, 번호, 링크, 브랜치 대비 정보를 포함한 상세 알림 전송.

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.
@moondev03 moondev03 self-assigned this Feb 25, 2026
@moondev03 moondev03 added the ✨ feat 새로운 기능 추가 또는 기존 기능 확장 label Feb 25, 2026
@moondev03 moondev03 linked an issue Feb 25, 2026 that may be closed by this pull request
2 tasks
@moondev03 moondev03 closed this Feb 25, 2026
@moondev03 moondev03 reopened this Feb 25, 2026
Removed 'Changes' field from PR notifications and updated color code.
@moondev03 moondev03 closed this Feb 25, 2026
@moondev03 moondev03 reopened this Feb 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f37e447 and 12fb9c9.

📒 Files selected for processing (1)
  • .github/workflows/pr-notifier.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pr-notifier.yml

Walkthrough

.new 워크플로우 파일 .github/workflows/pr-notifier.yml을 추가합니다. 이 워크플로우는 main, develop, release 브랜치의 pull_request 이벤트(opened, reopened, closed)에서 트리거되며, 이벤트 유형과 병합 여부에 따라 Discord 웹훅으로 조건부 알림을 전송합니다. 알림은 PR 작성자, 제목, 번호, URL 및 head→base 브랜치 정보를 포함하고 이벤트별로 다른 임베드 색상을 사용합니다.

Possibly related issues

  • PR Discord Webhook 연동 #68: 동일한 방식으로 PR 열린/재오픈/닫힘 이벤트를 Discord 웹훅으로 전송하는 워크플로우를 추가하므로 본 변경사항과 목적이 일치합니다.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 명확하게 요약하고 있으며, Discord 웹훅 통합이라는 주요 변경 사항을 정확하게 반영하고 있습니다.
Description check ✅ Passed PR 설명이 필수 섹션(작업 내용, 관련 이슈, 스크린샷)을 모두 포함하고 있으며, 각 항목이 충분히 작성되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Added a field name to PR notification messages.
@moondev03 moondev03 closed this Feb 25, 2026
@moondev03 moondev03 reopened this Feb 25, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07b7a08 and f37e447.

📒 Files selected for processing (1)
  • .github/workflows/pr-notifier.yml

@moondev03 moondev03 closed this Feb 25, 2026
@moondev03 moondev03 reopened this Feb 25, 2026
@moondev03 moondev03 added 🧹 chore 빌드, 설정, 의존성, 도구 관련 작업 and removed ✨ feat 새로운 기능 추가 또는 기존 기능 확장 labels Feb 25, 2026
Copy link
Contributor

@HamBeomJoon HamBeomJoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 chore 빌드, 설정, 의존성, 도구 관련 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR Discord Webhook 연동

2 participants