Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/discord-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Discord notify

# 이슈, PR, CI/CD 실패를 Discord로 알림. 실제 로직은 Han-Spoon/.github의 공용 workflow을 사용.
on:
issues:
types: [opened, reopened]
# fork PR에서도 secret을 쓰기 위해 pull_request_target 사용
pull_request_target:
types: [opened, reopened, ready_for_review, closed]
workflow_run:
workflows: ["CI", "Deploy (prod)"] # 주의: 각 workflow의 name과 일치해야 함
types: [completed]

permissions:
actions: read # 실패 job/step 조회
contents: read
pull-requests: read

jobs:
notify:
# CI/CD는 실패한 경우에만 알림
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'failure'
uses: Han-Spoon/.github/.github/workflows/discord-notify.yml@main
with:
team: Backend
secrets:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
Loading