Skip to content

Commit 4f37715

Browse files
kylemclarenclaude
andcommitted
Add auto-commit step for generated CLI docs in CI
The CI workflow now commits updated CLI documentation back to the PR branch when changes are detected. This ensures the generated docs stay in sync with the CLI. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 19d6f41 commit 4f37715

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '*.md'
99

1010
permissions:
11-
contents: read
11+
contents: write
1212
pull-requests: write
1313

1414
jobs:
@@ -20,6 +20,9 @@ jobs:
2020
cancel-in-progress: true
2121
steps:
2222
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.head_ref }}
25+
token: ${{ secrets.GITHUB_TOKEN }}
2326

2427
- uses: pnpm/action-setup@v4
2528
with:
@@ -49,6 +52,18 @@ jobs:
4952
- name: Generate CLI Docs
5053
run: pnpm generate:cli-docs
5154

55+
- name: Commit generated CLI docs
56+
run: |
57+
git config user.name "github-actions[bot]"
58+
git config user.email "github-actions[bot]@users.noreply.github.com"
59+
if git diff --quiet src/content/docs/cli/commands.mdx; then
60+
echo "No changes to CLI docs"
61+
else
62+
git add src/content/docs/cli/commands.mdx
63+
git commit -m "Update auto-generated CLI documentation"
64+
git push
65+
fi
66+
5267
- name: Build
5368
run: pnpm build
5469

0 commit comments

Comments
 (0)