From a4b86d0eb3ed4b182deabb7944a0c85483e3acde Mon Sep 17 00:00:00 2001 From: Dahyeon Jin <154739298+dahyeo-n@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:18:12 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20Conflict=20=EB=B0=9C=EC=83=9D=20?= =?UTF-8?q?=EC=8B=9C=EC=99=80=20PR/Issue=20=EC=83=9D=EC=84=B1,=20=EC=88=98?= =?UTF-8?q?=EC=A0=95,=20=EB=8B=AB=ED=9E=98=20=EC=9D=B4=EB=B2=A4=ED=8A=B8?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=ED=95=9C=20=EB=94=94=EC=8A=A4=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=95=8C=EB=A6=BC=20Actions=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr-issue-event-notifications.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pr-issue-event-notifications.yml 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 }}