Skip to content

Fetch Subscriptions Source #4067

Fetch Subscriptions Source

Fetch Subscriptions Source #4067

Workflow file for this run

name: Fetch Subscriptions Source
# 触发条件
on:
workflow_dispatch:
schedule:
- cron: '5 */1 * * *'
watch:
types: started
# - cron: '0 3,12 * * *'
# -'0 */1 * * *'
# -该规则表示每天从 0 点开始,每隔 1 个小时执行一次任务
# 表达式生成 https://crontab.guru/
jobs:
fetch:
runs-on: ubuntu-latest
steps:
- name: 迁出代码
uses: actions/checkout@v2
- name: 安装Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 加载缓存
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 设置时区
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: 安装依赖
run: |
pip install -r ./requirements.txt
- name: 执行任务
run: |
python ./main.py
- name: Commit
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add ./sub #这是pre_check.py定义的输出路径
git commit -m "🍀 爬取订阅源 $(date '+%Y-%m-%d %H:%M:%S')"
- name: 推送更改
uses: ad-m/github-push-action@master
with:
# github_token: ${{ secrets.TOKEN }}
branch: main