Get Duya Subscription #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |