From 9f34938cb34e947302b3da1d9bbd203194698362 Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:13:02 +0800 Subject: [PATCH 1/8] feat: added discord notif bot on pull requests --- .github/workflows/pr_notif.yml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/pr_notif.yml diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml new file mode 100644 index 0000000..e9510c8 --- /dev/null +++ b/.github/workflows/pr_notif.yml @@ -0,0 +1,47 @@ +name: Discord PR Notifications + +on: + pull_request: + types: [opened, reopened, closed] + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send Discord Notification + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + run: | + if [ "${{ github.event.pull_request.merged }}" = "true" ]; then + STATUS="Merged" + elif [ "${{ github.event.action }}" = "closed" ]; then + STATUS="Closed" + else + STATUS="Opened/Reopened" + fi + + curl -H "Content-Type: application/json" \ + -X POST \ + -d "{ + \"username\": \"GitHub PR Bot\", + \"embeds\": [{ + \"title\": \"PR $STATUS\", + \"description\": \"**${{ github.event.pull_request.title }}**\", + \"url\": \"${{ github.event.pull_request.html_url }}\", + \"color\": 5814783, + \"fields\": [ + { + \"name\": \"Author\", + \"value\": \"${{ github.event.pull_request.user.login }}\", + \"inline\": true + }, + { + \"name\": \"Branch\", + \"value\": \"${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\", + \"inline\": true + } + ] + }] + }" \ + $DISCORD_WEBHOOK_URL + From 3953631a3fe4c0376157b076f45af2c70aaeb1b2 Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:16:02 +0800 Subject: [PATCH 2/8] fix: incorrect github secret name --- .github/workflows/pr_notif.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index e9510c8..980d910 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Send Discord Notification env: - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_FRONTEND_WEBHOOK }} run: | if [ "${{ github.event.pull_request.merged }}" = "true" ]; then STATUS="Merged" @@ -43,5 +43,5 @@ jobs: ] }] }" \ - $DISCORD_WEBHOOK_URL + $DISCORD_FRONTEND_WEBHOOK From 5e7a0743ba60ca1d03c1dd3f8a6a0d6190830d4e Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:18:48 +0800 Subject: [PATCH 3/8] fix: applies to all branches --- .github/workflows/pr_notif.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index 980d910..73f8fd9 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -2,7 +2,8 @@ name: Discord PR Notifications on: pull_request: - types: [opened, reopened, closed] + branches: + - "**" jobs: notify: From 0246234ec914502cec8162760807a3c1e2b8ee70 Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:23:08 +0800 Subject: [PATCH 4/8] fix: test workflow --- .github/workflows/pr_notif.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index 73f8fd9..5776d0e 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -2,6 +2,7 @@ name: Discord PR Notifications on: pull_request: + types: [opened, closed, reopened, synchronize] branches: - "**" @@ -11,7 +12,7 @@ jobs: steps: - name: Send Discord Notification env: - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_FRONTEND_WEBHOOK }} + DISCORD_FRONTEND_WEBHOOK: ${{ secrets.DISCORD_FRONTEND_WEBHOOK }} run: | if [ "${{ github.event.pull_request.merged }}" = "true" ]; then STATUS="Merged" @@ -45,4 +46,3 @@ jobs: }] }" \ $DISCORD_FRONTEND_WEBHOOK - From e5b8377f2247b802bea75b8186884216c47ef511 Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:28:20 +0800 Subject: [PATCH 5/8] fix: test again --- .github/workflows/pr_notif.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index 5776d0e..f2378d3 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -25,7 +25,8 @@ jobs: curl -H "Content-Type: application/json" \ -X POST \ -d "{ - \"username\": \"GitHub PR Bot\", + \"username\": \"Heubert Ferolinux\", + \"avatar_url\": \"https://scontent.fceb3-1.fna.fbcdn.net/v/t39.30808-1/283535064_10221157236551714_4449793099043157969_n.jpg?stp=c55.0.1137.1137a_dst-jpg_s200x200_tt6&_nc_cat=105&ccb=1-7&_nc_sid=e99d92&_nc_eui2=AeFa--6ekHsExCaxntlXFaOOail8zadG3RRqKXzNp0bdFN7tshye6In02uJ9XLRkfZHiASaXcQGcu_KnCs3KJYrb&_nc_ohc=6Bda6lhwVLQQ7kNvwH5o62f&_nc_oc=Adnp5_SiOD17FCo4-XTl2xX3dMe93PQdXTb6uF_UGpx9-d4uOG1eQmE3wnTl3MhEoI0&_nc_zt=24&_nc_ht=scontent.fceb3-1.fna&_nc_gid=9IUql0xY5flRU4C_AlZicw&oh=00_AfvLH-wwbEaD-HPK0EtZTCHYQrp9nPvxN7Dl75z6p2w35w&oe=699A2490\", \"embeds\": [{ \"title\": \"PR $STATUS\", \"description\": \"**${{ github.event.pull_request.title }}**\", From 65d5b3d66ef1492b74a37e996b6aebb91636d09c Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:32:29 +0800 Subject: [PATCH 6/8] test: another test --- .github/workflows/pr_notif.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index f2378d3..d6a8798 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -27,6 +27,7 @@ jobs: -d "{ \"username\": \"Heubert Ferolinux\", \"avatar_url\": \"https://scontent.fceb3-1.fna.fbcdn.net/v/t39.30808-1/283535064_10221157236551714_4449793099043157969_n.jpg?stp=c55.0.1137.1137a_dst-jpg_s200x200_tt6&_nc_cat=105&ccb=1-7&_nc_sid=e99d92&_nc_eui2=AeFa--6ekHsExCaxntlXFaOOail8zadG3RRqKXzNp0bdFN7tshye6In02uJ9XLRkfZHiASaXcQGcu_KnCs3KJYrb&_nc_ohc=6Bda6lhwVLQQ7kNvwH5o62f&_nc_oc=Adnp5_SiOD17FCo4-XTl2xX3dMe93PQdXTb6uF_UGpx9-d4uOG1eQmE3wnTl3MhEoI0&_nc_zt=24&_nc_ht=scontent.fceb3-1.fna&_nc_gid=9IUql0xY5flRU4C_AlZicw&oh=00_AfvLH-wwbEaD-HPK0EtZTCHYQrp9nPvxN7Dl75z6p2w35w&oe=699A2490\", + \"content\": \"** My dear developers, naay PR to review ** 😋🚀\", \"embeds\": [{ \"title\": \"PR $STATUS\", \"description\": \"**${{ github.event.pull_request.title }}**\", From 9b5566ef82d085c28a5367e9c9d76775c55f7c3c Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:33:59 +0800 Subject: [PATCH 7/8] test: another test 2 --- .github/workflows/pr_notif.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index d6a8798..144f1c5 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -42,7 +42,6 @@ jobs: { \"name\": \"Branch\", \"value\": \"${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\", - \"inline\": true } ] }] From 76115d54480b174409a7b7a8c8c4b54c2934d03c Mon Sep 17 00:00:00 2001 From: Aya Date: Tue, 17 Feb 2026 18:35:30 +0800 Subject: [PATCH 8/8] fix: trailing comma --- .github/workflows/pr_notif.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_notif.yml b/.github/workflows/pr_notif.yml index 144f1c5..2d70a8e 100644 --- a/.github/workflows/pr_notif.yml +++ b/.github/workflows/pr_notif.yml @@ -41,7 +41,7 @@ jobs: }, { \"name\": \"Branch\", - \"value\": \"${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\", + \"value\": \"${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\" } ] }]