This commit is contained in:
zcong1993 2019-08-26 15:24:49 +08:00
parent 9846d50fd9
commit 9cca1b5dbd
4 changed files with 29 additions and 13 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.10
FROM appropriate/curl:latest
COPY LICENSE README.md /

View File

@ -1,5 +1,11 @@
# Container Action Template
# DingDing Notify Action
To get started, click the `Use this template` button on this repository [which will create a new repository based on this template](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/).
Send dingding simple notify message.
For info on how to build your first Container action, see the [toolkit docs folder](https://github.com/actions/toolkit/blob/master/docs/container-action.md).
```yaml
- name: Send dingding notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TOKEN }}
message: test message
```

View File

@ -1,12 +1,14 @@
name: 'Container Action Template'
description: 'Get started with Container actions'
author: 'GitHub'
name: 'DingDing Notify Action'
description: 'Send dingding simple notify message'
author: 'zcong1993'
inputs:
myInput:
description: 'Input to use'
default: 'world'
dingToken:
description: 'DingDing bot token'
required: true
message:
description: 'Message to send'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.myInput }}

View File

@ -1,3 +1,11 @@
#!/bin/sh -l
echo "hello $1"
url="https://oapi.dingtalk.com/robot/send?access_token=${INPUT_DINGTOKEN}"
curl "$url" \
-H 'Content-Type: application/json' \
-d "{\"msgtype\": \"text\",
\"text\": {
\"content\": \"${INPUT_MESSAGE}\"
}
}"