Merge pull request #1 from Atticuszz/dependabot/pip/pytest-cov-5.0.0 #2
This file contains 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: Run Python Script and Update README | |
on: | |
push: | |
branches: | |
- main | |
- test | |
paths-ignore: | |
- "README.md" # 忽略README.md文件的变更 | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: "main" | |
fetch-depth: 0 | |
token: ${{ secrets.ATTICUS_PAT }} | |
- name: Configuring git credentials | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Atticuszz" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pygizmokit pre-commit | |
- name: Run pre-commit hooks | |
run: pre-commit run --all-files | |
continue-on-error: true | |
- name: Run the script for navigation links | |
run: markdown --root ${{ github.workspace }} generate_nav --output ${{ github.workspace }}/README.md --dir docs --title "## Navigation" | |
- name: Run the script for recently modified | |
run: markdown --root ${{ github.workspace }} modify_recent --output ${{ github.workspace }}/README.md --num_commits 15 --dir docs --title "## Modified" | |
- name: Run the script for converting wiki links | |
run: markdown --root ${{ github.workspace }} convert_wiki_links | |
- name: Commit README changes | |
if: ${{ github.event.head_commit.message != 'Ci workflows Update README.md' }} # 添加条件 | |
run: | | |
git add . | |
git commit -m "Ci workflows Update README.md" || echo "No changes to commit" | |
git push origin main --force |