Update discord-notification.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Dump GitHub event payload | ||
run: echo "${{ toJson(github.event) }}" | ||
- 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.discussion.html_url }}\"}" \ | ||
${{ secrets.DISCORD_WEBHOOK_URL }} | ||
env: | ||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} |