-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (30 loc) · 1005 Bytes
/
duya.yml
File metadata and controls
38 lines (30 loc) · 1005 Bytes
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
name: Get Duya Subscription
on:
workflow_dispatch: # 手动触发
jobs:
get-sub:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install required packages
run: pip install requests
- name: Run duya.py script
id: run-script
run: |
# 运行脚本并捕获输出(替换换行符)
output=$(python duya.py 2>&1 | tr '\n' ' ')
# 设置输出变量(单行格式)
echo "result=$output" >> $GITHUB_OUTPUT
# 写入文件(保留原始格式)
echo "$output" > subscription.txt
- name: Upload subscription file
uses: actions/upload-artifact@v4
with:
name: duya-subscription
path: subscription.txt
retention-days: 1