Skip to content

Automatically update README with latest file navigation #19394

Automatically update README with latest file navigation

Automatically update README with latest file navigation #19394

Workflow file for this run

name: Update README
on:
push:
branches:
- main # 在 main 分支推送时触发
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PAT }} # 使用 PAT 进行身份验证
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytz
- name: Generate file navigation
run: |
python .github/generate_navigation.py
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add README.md
git commit -m "Automatically update README with latest file navigation"
git push https://${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git