--- name: Docs - Update Wiki 'on': push: branches: - main paths: - 'cli/core/schema/**/*.json' # JSON schema files - '.wiki/**' # Static wiki pages - '.github/scripts/generate_wiki_docs.py' # Wiki generation script - '.github/workflows/docs-update-wiki.yaml' # This workflow workflow_dispatch: # Allow manual trigger permissions: contents: write jobs: update-wiki: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 1 - name: Checkout wiki repository uses: actions/checkout@v6 with: repository: ${{ github.repository }}.wiki path: wiki token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v6 with: python-version: '3.14' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e . - name: Generate variable documentation run: | python3 .github/scripts/generate_wiki_docs.py wiki/ - name: Sync wiki pages from .wiki directory run: | # Copy all markdown files from .wiki/ to wiki/ (except Variables-*.md which are auto-generated) if [ -d ".wiki" ]; then echo "Syncing wiki pages from .wiki/ directory..." for file in .wiki/*.md; do filename=$(basename "$file") # Skip auto-generated variable documentation files if [[ ! "$filename" =~ ^Variables- ]]; then echo " Copying $filename" cp "$file" "wiki/$filename" fi done else echo "No .wiki directory found, skipping static wiki pages sync" fi - name: Check for changes id: changes working-directory: wiki run: | git add . if git diff --staged --quiet; then echo "has_changes=false" >> $GITHUB_OUTPUT echo "No changes detected in wiki documentation" else echo "has_changes=true" >> $GITHUB_OUTPUT echo "Changes detected in wiki documentation" fi - name: Commit and push changes if: steps.changes.outputs.has_changes == 'true' working-directory: wiki run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git commit -m "Auto-update wiki pages" # Pull with rebase to handle any remote changes, then push # GitHub wikis use master as default branch git pull --rebase origin master git push origin master - name: Summary run: | if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then echo "Wiki variable documentation updated successfully" echo "View at: https://github.com/${{ github.repository }}/wiki" else echo "No changes to wiki documentation" fi