Skip to content

Daily Github Ranking Update #80

Daily Github Ranking Update

Daily Github Ranking Update #80

name: Daily Github Ranking Update
on:
schedule:
# 每天北京时间上午 08:00 运行 (UTC 00:00)
- cron: "0 0 * * *"
workflow_dispatch: # 允许手动点击运行
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write # 显式授予写权限,以便自动提交更新
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # 自动缓存并恢复 pip 依赖
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pandas requests deep-translator
- name: Create Access Token File
run: echo "${{ secrets.GH_TOKEN }}" > access_token.txt
- name: Run Update Script
run: python source/process.py
- name: Commit and Push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md Top100/ Data/ index.html translations_cache.json
git commit -m "chore: daily update ranking [$(date -u +'%Y-%m-%d %H:%M:%S')]" || echo "No changes to commit"
git push