Send DingTalk notify message
STEP 1: Follow the tutorial to setup a DingTalk bot.
We will get a webhook url like https://oapi.dingtalk.com/robot/send?access_token=xxx
STEP 2: Go to your repository settings page(https://github.com/USERNAME/REPO/settings/secrets) to create some secrets.
At least we need to create a secret named "DINGTALK_TOKEN" with value of "access_token" in the webhook url.
For singed bot we also need to create a secret named "DINGTALK_SECRET" with the value of secret-key.
STEP 3: Create a workflow file .github/workflows/dingtalk-notify.yml in your repository
name: DingTalk Notify
on:
push:
branches:
- master
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/dingtalk-notify@v1
with:
token: ${{ secrets.DINGTALK_TOKEN }}
secret: ${{ secrets.DINGTALK_SECRET }} # only for signed bot
msgtype: text
content: |
{
"content": "Hello DingTalk"
}Various inputs are defined to let you configure the action:
Note: Workflow command and parameter names are not case-sensitive.
| Name | Required | Description | Default |
|---|---|---|---|
token |
✔️ | Dingtalk bot token | |
secret |
Dingtalk bot secret to sign the request | ||
msgtype |
Dingtalk message type. Valid types are: 'text', 'markdown', 'link', 'actionCard', 'feedCard'. |
'text' |
|
content |
✔️ | Dingtalk message content in JSON type | |
at |
Users to at in JSON type, or set to 'all' to at all users |
||
ignoreError |
If set true, will not fail action when sending message failed | false |
The scripts and documentation in this project are released under the MIT License.
