Automatically update README with latest file navigation #19429
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: 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 |