Files
bpf-developer-tutorial/.github/workflows/auto-generate-docs.yml
云微 39e3f59119 ci: support Rust 1.97 and modernize workflows (#210)
* Modernize workflow actions and permissions

* Test the fentry tutorial in CI

* Support Rust 1.97 symbol mangling

* Limit documentation writes to main

* Harden Rust symbol resolution

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
2026-07-14 03:58:41 -07:00

50 lines
1.2 KiB
YAML

name: Auto Generate Documentation
on:
push:
branches: [main]
paths:
- 'src/**/README.md'
- 'src/**/README.zh.md'
- 'src/**/.config'
- 'scripts/generate_toc.py'
- 'scripts/*.template'
workflow_dispatch:
permissions:
contents: write
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Generate documentation
run: |
python3 scripts/generate_toc.py
- name: Check for changes
id: check_changes
run: |
git diff --quiet || echo "has_changes=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md README.zh.md src/SUMMARY.md src/SUMMARY.zh.md
git commit -m "docs: auto-generate documentation"
git push