Skip to content

Commit

Permalink
Create discord-notification.yml
Browse files Browse the repository at this point in the history
Create proper GH Action for sending notifications to Discord
  • Loading branch information
bxpana authored Apr 8, 2024
1 parent 9776f37 commit 07a2251
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/discord-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Notify Discord on Labeled Discussion

on:
discussion:
types: [created]

jobs:
notify-discord:
runs-on: ubuntu-latest
if: contains(github.event.discussion.labels.*.name, 'show-and-tell')
steps:
- name: Send Notification to Discord
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"A new labeled discussion has been created: ${GITHUB_EVENT_PATH}\"}" \
${{ secrets.DISCORD_WEBHOOK_URL }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
GITHUB_EVENT_DISCUSSION_URL: ${{ github.event.discussion.html_url }}

0 comments on commit 07a2251

Please sign in to comment.