From 5642aab95dc32cabc4c72e6df8c6fd7074484868 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 May 2026 06:18:01 +0000 Subject: [PATCH] feat: add Discord commit notification workflow Agent-Logs-Url: https://github.com/th30d4y/0Commits/sessions/8f3870c1-c746-4fd8-9109-be61d25775bb Co-authored-by: 0x5t4l1n <161853795+0x5t4l1n@users.noreply.github.com> --- .github/workflows/discord-notify.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/discord-notify.yml diff --git a/.github/workflows/discord-notify.yml b/.github/workflows/discord-notify.yml new file mode 100644 index 0000000..1a5ecdd --- /dev/null +++ b/.github/workflows/discord-notify.yml @@ -0,0 +1,39 @@ +name: Discord Commit Notification + +on: + push: + branches: + - '**' + +jobs: + notify: + runs-on: ubuntu-latest + + steps: + - name: Send Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + run: | + COMMIT_SHA="${{ github.sha }}" + SHORT_SHA="${COMMIT_SHA:0:7}" + COMMIT_MESSAGE="${{ github.event.head_commit.message }}" + AUTHOR="${{ github.event.head_commit.author.name }}" + BRANCH="${{ github.ref_name }}" + REPO="${{ github.repository }}" + COMMIT_URL="https://github.com/${REPO}/commit/${COMMIT_SHA}" + + curl -s -X POST "$DISCORD_WEBHOOK" \ + -H "Content-Type: application/json" \ + -d "{ + \"embeds\": [{ + \"title\": \"New Commit in \`${REPO}\`\", + \"url\": \"${COMMIT_URL}\", + \"color\": 5814783, + \"fields\": [ + { \"name\": \"Author\", \"value\": \"${AUTHOR}\", \"inline\": true }, + { \"name\": \"Branch\", \"value\": \"\`${BRANCH}\`\", \"inline\": true }, + { \"name\": \"Commit\", \"value\": \"[\`${SHORT_SHA}\`](${COMMIT_URL})\", \"inline\": true }, + { \"name\": \"Message\", \"value\": \"${COMMIT_MESSAGE}\" } + ] + }] + }"