Skip to content

feat(docs): add docs_gen module for auto-generating option tables #2

feat(docs): add docs_gen module for auto-generating option tables

feat(docs): add docs_gen module for auto-generating option tables #2

Workflow file for this run

name: Update docs
on:
push:
branches:
- main
pull_request:
jobs:
update_docs:
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Run update_docs.py
env:
TERM: dumb
NO_COLOR: 1
TERMINAL_WIDTH: 90
run: |
uv sync
uv run python docs/update_docs.py
find . -name "*.md" -exec sed -i '' 's/[[:space:]]*$//' {} \;
- name: Commit updated docs
id: commit
run: |
git add -A
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if git diff --quiet && git diff --staged --quiet; then
echo "No changes in docs, skipping commit."
echo "commit_status=skipped" >> $GITHUB_ENV
else
git commit -m "Update auto-generated docs"
echo "commit_status=committed" >> $GITHUB_ENV
fi
- name: Push changes
if: env.commit_status == 'committed'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}