-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 995 Bytes
/
update-feed.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
name: Update HuggingFace Trending Feed
on:
schedule:
- cron: '0 0 * * *' # 每天运行一次
workflow_dispatch: # 允许手动触发
jobs:
update-feed:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update feeds
run: python update_feed.py
- name: Commit and push if changed
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add docs/
git diff --quiet && git diff --staged --quiet || (git commit -m "Update feeds" && git push origin main)
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}