fix sh script&change a+b prob demo to unsigned longlongint #28
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: Discord Notification | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
jobs: | |
discordNotification: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set commit message | |
id: commit | |
run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)" | |
- name: Get current time | |
id: current_time | |
run: echo "::set-output name=time::$(date +'%Y-%m-%d %H:%M:%S')" | |
- name: Send Discord notification on push | |
if: github.event_name == 'push' | |
run: | | |
curl -X POST -H "Content-Type: application/json" \ | |
-d '{ | |
"content": "New push in the repository.", | |
"username": "GitHub", | |
"avatar_url": "https://github.com/favicon.ico", | |
"embeds": [ | |
{ | |
"title": "Git Push Details", | |
"description": "Repo: ${{ github.repository }}\nOperator: ${{ github.actor }}\nTime: ${{ steps.current_time.outputs.time }}\nGit Commit Hash: [${{ github.sha }}](${{ github.event.compare }})\nContent: ${{ steps.commit.outputs.message }}", | |
"color": 16777215 | |
} | |
] | |
}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |
- name: Send Discord notification on release | |
if: github.event_name == 'release' | |
run: | | |
curl -X POST -H "Content-Type: application/json" \ | |
-d '{ | |
"content": "New release in the repository!", | |
"username": "GitHub", | |
"avatar_url": "https://github.com/favicon.ico", | |
"embeds": [ | |
{ | |
"title": "Release Details", | |
"description": "description": "Repo: ${{ github.repository }}\nOperator: ${{ github.actor }}\nTime: ${{ steps.current_time.outputs.time }}\nTag: ${{ github.event.release.tag_name }}\nRelease Notes: ${{ github.event.release.body }}", | |
"color": 16777215 | |
} | |
] | |
}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} |