-
Notifications
You must be signed in to change notification settings - Fork 125
151 lines (135 loc) · 5.09 KB
/
Copy pathci.yml
File metadata and controls
151 lines (135 loc) · 5.09 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: telegram message
on:
push:
branches:
- "**"
jobs:
# Tests the working-tree Dockerfile and entrypoint.sh; the build job below
# runs against the published image referenced by action.yml instead.
local-image:
name: Test local image build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: build image from working tree
run: docker build -t telegram-action:local .
- name: send message via local image
env:
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
run: |
docker run --rm \
-e INPUT_TO="$TELEGRAM_TO" \
-e INPUT_TOKEN="$TELEGRAM_TOKEN" \
-e INPUT_MESSAGE_THREAD_ID= \
-e INPUT_MESSAGE="ci: local image smoke test for ${{ github.sha }}" \
telegram-action:local
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: send message using with
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
The ${{ github.event_name }} event triggered second step.
show the github variable ref: ${{ github.ref }}
show the github variable commit: ${{ github.sha }}
show the github variable ref: {{ commit.ref }}
show the github variable commit: {{ commit.sha }}
Commit Message: ${{ github.event.head_commit.message }}
- name: send default message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
- name: send photo message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: send photo message
photo: "./tests/github.png"
document: "./tests/gophercolor.png"
- name: send location message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: "24.9163213 121.1424972"
venue: "35.661777 139.704051 竹北體育館 新竹縣竹北市"
- name: send custom message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
The ${{ github.event_name }} event triggered final step.
echo This event is a pull request that had an assignee removed.
- name: send message file
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message_file: tests/message.txt
# Regression test for issue #68: step outputs written to $GITHUB_OUTPUT
# must be usable inside the message input. The step producing the
# output needs an `id` so it can be referenced via steps.<id>.outputs.
- name: set step output
id: repo-discussion
run: |
COUNT=42
echo "discussionCount=$COUNT" >> "$GITHUB_OUTPUT"
- name: verify step output is interpolated
run: |
test "${{ steps.repo-discussion.outputs.discussionCount }}" = "42"
- name: send message with step output (issue #68)
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
There are currently ${{ steps.repo-discussion.outputs.discussionCount }} discussions, come on!
format: markdown
# - name: send message using socks5 proxy URL
# uses: appleboy/telegram-action@master
# with:
# to: ${{ secrets.TELEGRAM_TO }}
# token: ${{ secrets.TELEGRAM_TOKEN }}
# socks5: "http://222.124.154.19:23500"
# message: Send message from socks5 proxy URL.
# - name: try multiple message
# uses: appleboy/telegram-action@master
# with:
# to: ${{ secrets.TELEGRAM_TO }}
# token: ${{ secrets.TELEGRAM_TOKEN }}
# format: html
# message: |
# ⚡️ <a href="https://github.com/aszenz/repo/commit/${{ github.event.push.after }}">Commits</a> pushed to master by <em>${{ github.event.push.pusher.name }}</em> ⚡️
# ${{ github.actor }}:${{ github.event.head_commit.message }}
- name: link preview
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
show link preview https://google.com.tw
- name: disable link preview
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
message: |
disable link preview https://google.com.tw
- name: sending a message without notification
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_notification: true
message: |
disable link preview https://google.com.tw