Created
January 24, 2023 07:10
-
-
Save xxiz/b82434cbc7192522fe29b1d2b955c8f5 to your computer and use it in GitHub Desktop.
github actions to push to discord webhook
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: 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