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 and All Articles | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/all-articles.md' | |
| workflow_dispatch: | |
| jobs: | |
| update-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Generate README and all-articles | |
| run: python scripts/generate_readme.py --target both | |
| - name: Check if files changed | |
| id: check_changes | |
| run: | | |
| if git diff --quiet README.md docs/all-articles.md; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push if changed | |
| if: steps.check_changes.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add README.md docs/all-articles.md | |
| git commit -m "docs: auto-update README and all-articles" | |
| git push |