diff --git a/.github/workflows/ai-docs.yml b/.github/workflows/ai-docs.yml new file mode 100644 index 00000000..a5cf1726 --- /dev/null +++ b/.github/workflows/ai-docs.yml @@ -0,0 +1,44 @@ +name: Generate AI Documentation + +on: + push: + branches: + - 'trunk' + +jobs: + generate-ai-docs: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install repomix + run: npm install -g repomix + + - name: Generate AI documentation + run: repomix --style=markdown docs/ example/ -o docs/ai.md + + - name: Check for changes + id: git-check + run: | + git add docs/ai.md + git diff --staged --quiet docs/ai.md || echo "changes=true" >> $GITHUB_OUTPUT + + - name: Commit changes + if: steps.git-check.outputs.changes == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "Docs: update AI documentation" docs/ai.md + git push diff --git a/docs/index.md b/docs/index.md index 5a6c9fac..790689a8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -35,6 +35,7 @@ For plugin overview and getting started guide, see [README](../README.md). ## Additional Documentation +- [AI Documentation](ai.md) - [Contributing Guidelines](../CONTRIBUTING.md) - [Security Policy](../SECURITY.md) - [Code of Conduct](https://make.wordpress.org/handbook/community-code-of-conduct/)