-
Notifications
You must be signed in to change notification settings - Fork 6.1k
52 lines (42 loc) · 1.74 KB
/
tg.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
name: TG推送
on:
push:
branches:
- main
paths:
- 'addressesapi.txt'
workflow_dispatch: # 手动触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 加载当前的 GitHub 库
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Get Beijing Time
id: time
run: |
TIME_ZONE="Asia/Shanghai"
CURRENT_TIME=$(TZ=${TIME_ZONE} date +"%Y-%m-%d %H:%M:%S")
echo "::set-output name=current_time::${CURRENT_TIME}"
- name: 执行推送
run: |
head -n 8 addressesapi.txt > addressesapi_truncated.txt
while IFS= read -r line; do
ips+="$(echo "$line" | sed 's/#/, /g')"$'\n'
done < addressesapi_truncated.txt
message="今日优选 For: ${{ steps.time.outputs.current_time }}
${ips}...更多优选IP可通过自定义订阅方式获取
https://sub.cmliucdn.tk/sub?host=<你的Vless域名>&uuid=<你的UUID>&path=<你的ws路径>
如果你的vless是通过worker部署且没有path参数,可填入以下对应参数后订阅节点信息
https://sub.cmliucdn.tk/sub?host=<你的Worker域名>&uuid=<你的UUID>
实际使用时请去掉<>符号
注意:您可以将此链接分享传播到任何地方😁"
# wget -qO- "https://api.telegram.org/bot${{ secrets.TG_BOT_TOKEN }}/sendMessage?chat_id=${{ secrets.TG_TESTPD_ID }}&text=$message"
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
-d "chat_id=${{ secrets.TG_TESTPD_ID }}" \
-d "text=${message}" \
"https://api.telegram.org/bot${{ secrets.TG_BOT_TOKEN }}/sendMessage"