docs-update-wiki-variables.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. name: Docs - Update Wiki Variables
  3. 'on':
  4. push:
  5. branches:
  6. - main
  7. paths:
  8. - 'cli/modules/*/spec_*.py'
  9. - 'cli/modules/*/__init__.py'
  10. - '.github/scripts/generate_wiki_docs.py'
  11. - '.github/workflows/docs-update-wiki-variables.yaml'
  12. workflow_dispatch: # Allow manual trigger
  13. permissions:
  14. contents: write
  15. jobs:
  16. update-wiki:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout repository
  20. uses: actions/checkout@v5
  21. with:
  22. fetch-depth: 1
  23. - name: Checkout wiki repository
  24. uses: actions/checkout@v5
  25. with:
  26. repository: ${{ github.repository }}.wiki
  27. path: wiki
  28. token: ${{ secrets.GITHUB_TOKEN }}
  29. - name: Set up Python
  30. uses: actions/setup-python@v6
  31. with:
  32. python-version: '3.14'
  33. - name: Install dependencies
  34. run: |
  35. python -m pip install --upgrade pip
  36. pip install typer rich pyyaml jinja2
  37. - name: Generate variable documentation
  38. run: |
  39. python3 .github/scripts/generate_wiki_docs.py wiki/
  40. - name: Check for changes
  41. id: changes
  42. working-directory: wiki
  43. run: |
  44. git add .
  45. if git diff --staged --quiet; then
  46. echo "has_changes=false" >> $GITHUB_OUTPUT
  47. echo "No changes detected in wiki documentation"
  48. else
  49. echo "has_changes=true" >> $GITHUB_OUTPUT
  50. echo "Changes detected in wiki documentation"
  51. fi
  52. - name: Commit and push changes
  53. if: steps.changes.outputs.has_changes == 'true'
  54. working-directory: wiki
  55. run: |
  56. git config user.name "github-actions[bot]"
  57. git config user.email "github-actions[bot]@users.noreply.github.com"
  58. git commit -m "Auto-update variable documentation from schema changes"
  59. git push
  60. - name: Summary
  61. run: |
  62. if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then
  63. echo "Wiki variable documentation updated successfully"
  64. echo "View at: https://github.com/${{ github.repository }}/wiki"
  65. else
  66. echo "No changes to wiki documentation"
  67. fi