Skip to content

Commit 2ee8c77

Browse files
CedrickGDclaude
andcommitted
Refactor Discord notification workflow to support multiple channels
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4c9048f commit 2ee8c77

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/discord-release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
env:
1919
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
2020
DISCORD_WEBHOOK_2: ${{ secrets.DISCORD_WEBHOOK_2 }}
21+
DISCORD_WEBHOOK_3: ${{ secrets.DISCORD_WEBHOOK_3 }}
2122
run: |
2223
if [ -z "$DISCORD_WEBHOOK" ]; then
2324
echo "::error::Missing DISCORD_WEBHOOK repository secret."
@@ -26,11 +27,15 @@ jobs:
2627
if [ -z "$DISCORD_WEBHOOK_2" ]; then
2728
echo "::warning::Missing DISCORD_WEBHOOK_2 repository secret. Skipping second webhook."
2829
fi
30+
if [ -z "$DISCORD_WEBHOOK_3" ]; then
31+
echo "::warning::Missing DISCORD_WEBHOOK_3 repository secret. Skipping third webhook."
32+
fi
2933
3034
- name: Send Discord notification
3135
env:
3236
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
3337
DISCORD_WEBHOOK_2: ${{ secrets.DISCORD_WEBHOOK_2 }}
38+
DISCORD_WEBHOOK_3: ${{ secrets.DISCORD_WEBHOOK_3 }}
3439
EVENT_NAME: ${{ github.event_name }}
3540
REPO: ${{ github.repository }}
3641
ACTOR: ${{ github.actor }}
@@ -101,3 +106,15 @@ jobs:
101106
cat discord_response2.txt
102107
fi
103108
fi
109+
110+
if [ -n "$DISCORD_WEBHOOK_3" ]; then
111+
http_code3="$(curl -sS -o discord_response3.txt -w "%{http_code}" \
112+
-H "Content-Type: application/json" \
113+
-d "$payload" \
114+
"$DISCORD_WEBHOOK_3")"
115+
116+
if [ "$http_code3" -lt 200 ] || [ "$http_code3" -ge 300 ]; then
117+
echo "::warning::Discord webhook 3 returned HTTP $http_code3"
118+
cat discord_response3.txt
119+
fi
120+
fi

0 commit comments

Comments
 (0)