Skip to content

Discord Release Notification #1

Discord Release Notification

Discord Release Notification #1

name: Discord Release Notification
on:
release:
types: [published, created, edited]
workflow_dispatch:
jobs:
notify_discord:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Send Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_ANN }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_NAME: ${{ github.event.release.name }}
RELEASE_BODY: ${{ github.event.release.body }}
RELEASE_URL: ${{ github.event.release.html_url }}
run: |
echo "Sending notification for release: $RELEASE_TAG"
curl -H "Content-Type: application/json" -X POST -d @- $DISCORD_WEBHOOK <<EOF
{
"embeds": [{
"title": "New Release: $RELEASE_TAG",
"description": "$RELEASE_NAME\n\n$RELEASE_BODY",
"url": "$RELEASE_URL",
"color": 3066993
}]
}
EOF