diff --git a/.github/workflows/pr-issue-event-notifications.yml b/.github/workflows/pr-issue-event-notifications.yml new file mode 100644 index 0000000..7120534 --- /dev/null +++ b/.github/workflows/pr-issue-event-notifications.yml @@ -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 }}