Files
SpacetimeDB/.github/workflows/discord-posts.yml
Zeke Foppa 2b291b025c CI - Post-to-discord workflow only fires if the PR merged to master (#1520)
Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-16 17:16:33 +00:00

23 lines
738 B
YAML

name: Discord notifications
on:
pull_request:
types: [closed]
jobs:
discordNotification:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'master'
steps:
- name: Send Discord notification
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
curl -X POST -H 'Content-Type: application/json' -d '{
"content": "'"PR merged: [(#${PR_NUMBER}) ${PR_TITLE}](${PR_URL})"'"
}' ${DISCORD_WEBHOOK_URL}