-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (80 loc) · 2.73 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 'build-test'
on:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
test_msg_type_post:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
webhook: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
title: I'm title
content: |
I'm message body
from: ${{ github.repository }}
test_msg_type_post_by_using_bin_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Send feishu message
env:
ACTIONS_FEISHU_TAG: 'v1.3.1'
INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}"
INPUT_TITLE: "I'm title"
INPUT_CONTENT: "I'm message body\nfrom: ${{ github.repository }}"
run: |
wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
tar zxf linux-amd64-actions-feishu.tar.gz feishu
./feishu
test_msg_type_template:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v4
id: set-template-values
with:
script: |
return JSON.stringify({
title: "每日一问",
text: "吃了吗?🍚",
yes_button_text: "吃了",
no_button_text: "没吃",
})
result-encoding: string
- uses: ./
with:
webhook: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
message_type: "template"
msg_template_path: '.github/feishu_msg_tmpl/example.json'
msg_template_values: "${{steps.set-template-values.outputs.result}}"
test_msg_type_template_by_using_bin_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v4
id: set-template-values
with:
script: |
return JSON.stringify({
title: "每日一问(2)",
text: "吃了吗?🍚",
yes_button_text: "吃了",
no_button_text: "没吃",
})
result-encoding: string
- name: Send feishu message
env:
ACTIONS_FEISHU_TAG: 'v1.3.1'
INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}"
INPUT_MESSAGE_TYPE: template
INPUT_MSG_TEMPLATE_PATH: ".github/feishu_msg_tmpl/example.json"
INPUT_MSG_TEMPLATE_VALUES: "${{ steps.set-template-values.outputs.result }}"
run: |
wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
tar zxf linux-amd64-actions-feishu.tar.gz feishu
./feishu