test: add draft and format-error test articles [test] #29
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' | |
| - 'docs/all-categories.md' | |
| - 'mkdocs.yml' | |
| workflow_dispatch: | |
| jobs: | |
| update-docs: | |
| if: github.actor != 'github-actions[bot]' || !contains(github.event.head_commit.message, '[skip ci]') | |
| runs-on: ubuntu-latest | |
| 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.11' | |
| - name: Install dependencies | |
| run: pip install pyyaml | |
| - name: Check markdown docs | |
| run: python scripts/check_docs.py --report-json artifacts/check-report.json --summary-md artifacts/check-summary.md || true | |
| - name: Generate README, all-articles and mkdocs nav | |
| run: python scripts/generate_readme.py --target all | |
| - name: Append check summary | |
| if: always() | |
| run: | | |
| if [ -f artifacts/check-summary.md ]; then | |
| cat artifacts/check-summary.md >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Check if files changed | |
| id: check_changes | |
| run: | | |
| if git diff --quiet README.md docs/all-articles.md docs/all-categories.md mkdocs.yml; 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 docs/all-categories.md mkdocs.yml | |
| git commit -m "docs: auto-update README, all-articles, all-categories and mkdocs nav [skip ci]" | |
| git push |