53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: DingTalk Text Notification
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
webhook_url:
|
|
description: "钉钉机器人 Webhook URL"
|
|
required: true
|
|
type: string
|
|
content:
|
|
description: "文本消息内容"
|
|
required: true
|
|
default: "手动触发的文本消息示例"
|
|
type: string
|
|
at_mobiles:
|
|
description: "@指定手机号 (可选,多个用逗号分隔)"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
at_all:
|
|
description: "是否@所有人"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
env:
|
|
DINGTALK_WEBHOOK: ${{ github.event.inputs.webhook_url }}
|
|
|
|
jobs:
|
|
send-text:
|
|
runs-on: ubuntu-latest
|
|
name: 发送文本消息
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 发送基础文本消息
|
|
uses: ./
|
|
with:
|
|
webhook_url: ${{ env.DINGTALK_WEBHOOK }}
|
|
message_type: text
|
|
content: ${{ github.event.inputs.content }}
|
|
|
|
- name: 带@功能的文本消息
|
|
if: ${{ github.event.inputs.at_mobiles != '' || github.event.inputs.at_all == 'true' }}
|
|
uses: ./
|
|
with:
|
|
webhook_url: ${{ env.DINGTALK_WEBHOOK }}
|
|
message_type: text
|
|
content: ${{ github.event.inputs.content }}
|
|
at_mobiles: ${{ github.event.inputs.at_mobiles }}
|
|
at_all: ${{ github.event.inputs.at_all }}
|