-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for AI documentation generation (#384)
- Loading branch information
1 parent
4f6e62a
commit 32516b9
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains 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