feat: 添加 gitea action 使用示例
This commit is contained in:
53
.gitea/workflows/dingtalk-markdown.yml
Normal file
53
.gitea/workflows/dingtalk-markdown.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: DingTalk Markdown Notification
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
webhook_url:
|
||||
description: "钉钉机器人 Webhook URL"
|
||||
required: true
|
||||
type: string
|
||||
title:
|
||||
description: "消息标题"
|
||||
required: true
|
||||
default: "示例 Markdown 标题"
|
||||
type: string
|
||||
content:
|
||||
description: "Markdown 消息内容"
|
||||
required: true
|
||||
default: "这是一个手动触发的 Markdown 示例消息"
|
||||
type: string
|
||||
at_mobiles:
|
||||
description: "@指定手机号 (可选,多个用逗号分隔)"
|
||||
required: false
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
env:
|
||||
DINGTALK_WEBHOOK: ${{ github.event.inputs.webhook_url }}
|
||||
|
||||
jobs:
|
||||
send-markdown:
|
||||
runs-on: ubuntu-latest
|
||||
name: 发送 Markdown 消息
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 发送基础 Markdown 消息
|
||||
uses: ./
|
||||
with:
|
||||
webhook_url: ${{ env.DINGTALK_WEBHOOK }}
|
||||
message_type: markdown
|
||||
title: ${{ github.event.inputs.title }}
|
||||
content: ${{ github.event.inputs.content }}
|
||||
|
||||
- name: 带@功能的 Markdown 消息
|
||||
if: ${{ github.event.inputs.at_mobiles != '' }}
|
||||
uses: ./
|
||||
with:
|
||||
webhook_url: ${{ env.DINGTALK_WEBHOOK }}
|
||||
message_type: markdown
|
||||
title: ${{ github.event.inputs.title }}
|
||||
content: ${{ github.event.inputs.content }}
|
||||
at_mobiles: ${{ github.event.inputs.at_mobiles }}
|
||||
Reference in New Issue
Block a user