Plugin Documentation Generator #8
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
| # Workflow to run plugin documentation generation then commit the updated changes | |
| name: Plugin Documentation Generator | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| generate_docs: | |
| runs-on: [ self-hosted ] | |
| # To disable this workflow, set DISABLE_AUTO_DOCS to 'true' in repository variables | |
| if: vars.DISABLE_AUTO_DOCS != 'true' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: ./dev-setup.sh | |
| - name: Run plugin documentation generator | |
| run: | | |
| source venv/bin/activate | |
| python docs/generate_plugin_doc_bundle.py \ | |
| --package nodescraper.plugins.inband \ | |
| --output docs/PLUGIN_DOC.md | |
| - name: Format documentation with pre-commit | |
| run: | | |
| source venv/bin/activate | |
| pre-commit run --files docs/PLUGIN_DOC.md || true | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/PLUGIN_DOC.md | |
| git diff --staged --quiet || git commit --no-verify -m "docs: Update plugin documentation [automated]" | |
| git push |