Skip to content

Instantly share code, notes, and snippets.

@xxiz
Created January 24, 2023 07:10
Show Gist options
  • Save xxiz/b82434cbc7192522fe29b1d2b955c8f5 to your computer and use it in GitHub Desktop.
Save xxiz/b82434cbc7192522fe29b1d2b955c8f5 to your computer and use it in GitHub Desktop.
github actions to push to discord webhook
name: Send Commit Info to Discord
on:
push:
branches:
- main
jobs:
send_to_discord:
runs-on: ubuntu-latest
steps:
- name: Get Commit Info
run: echo "Commit Title: $GITHUB_HEAD_REF\nCommit Description: $GITHUB_EVENT_NAME"
- name: Send to Discord
run: |
curl -X POST -H "Content-Type: application/json" -d "{\"content\":\"$GITHUB_HEAD_REF\n$GITHUB_EVENT_NAME\"}" YOUR_DISCORD_WEBHOOK_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment