Skip to content

Commit

Permalink
docs: Conflict 발생 시와 PR/Issue 생성, 수정, 닫힘 이벤트에 대한 디스코드 알림 Actions 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dahyeo-n authored Jan 9, 2025
1 parent a625372 commit a4b86d0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pr-issue-event-notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR and Issue Event Notifications

on:
pull_request:
types: [opened, edited, closed, synchronize]
issues:
types: [opened, edited, closed]

jobs:
notify-discord:
runs-on: ubuntu-22.04

steps:
- name: Notify Discord on PR/Issue Events
uses: johnnyhuy/actions-discord-git-webhook@main
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
args: |
👾 **GitHub 이벤트 발생** 👾
**Event**: ${{ github.event_name }}
**Action**: ${{ github.event.action }}
**Repository**: ${{ github.repository }}
**Actor**: ${{ github.actor }}
**Title**: ${{ github.event.pull_request.title || github.event.issue.title }}
**Link**: ${{ github.event.pull_request.html_url || github.event.issue.html_url }}
---
🕒 **Timestamp**: ${{ github.event.pull_request.updated_at || github.event.issue.updated_at }}
- name: Notify Discord on Conflict in Pull Requests
if: ${{ github.event_name == 'pull_request' && github.event.action == 'synchronize' }}
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"content": "🚨 **PR Conflict 발생** 🚨\n\n**PR Title**: '${{ github.event.pull_request.title }}'\n**Branch**: '${{ github.event.pull_request.head.ref }}'\n**URL**: '${{ github.event.pull_request.html_url }}'"
}' \
${{ secrets.DISCORD_WEBHOOK }}

0 comments on commit a4b86d0

Please sign in to comment.