You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add GitHub Actions workflow that automatically updates documentation when PRs are opened or updated. The workflow:
- Triggers on PR events (opened, synchronize, reopened, ready_for_review)
- Uses Cursor AI to analyze changes and update relevant docs in docs/docs directory
- Creates a persistent docs branch for each PR
- Posts PR comments with links to view/merge doc updates
- Skips execution for docs-only branches to prevent infinite loops
This automation ensures documentation stays current with code changes while maintaining consistency with repository style.
- name: Generate docs updates (no commit/push/comment)
32
+
env:
33
+
MODEL: gpt-5
34
+
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
35
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
+
BRANCH_PREFIX: docs
37
+
run: |
38
+
cursor-agent -p "You are operating in a GitHub Actions runner.
39
+
40
+
The GitHub CLI is available as 'gh'.
41
+
login to github using the token: 'gh auth login --with-token < $GH_TOKEN'
42
+
Git is available as well.
43
+
44
+
IMPORTANT: Do NOT create branches, commit, push, or post PR comments. Only modify files in the working directory as needed. A later workflow step is responsible for publishing changes and commenting on the PR.
- Update repository documentation based on incremental changes introduced by this PR.
55
+
56
+
# Context:
57
+
- Docs for the repository are located in the 'docs/docs/' directory in a flat, markdown files structure.
58
+
59
+
# Requirements:
60
+
1) Determine what changed in the original PR (use 'gh pr diff' and git history as needed). If an existing persistent docs branch '${{ env.BRANCH_PREFIX }}/${{ github.head_ref }}' exists, you may use it as a read-only reference point to understand prior updates.
61
+
2) Update only the relevant docs based on those changes. Keep edits minimal and consistent with repo style.
62
+
3) Do NOT commit, push, create branches, or post PR comments. Leave the working tree with updated files only; a later step will publish.
63
+
64
+
# Inputs and conventions:
65
+
- Use 'gh pr diff' and git history to detect changes and focus documentation edits accordingly.
66
+
- Proceed with making changes only when any '*.py' files in 'application_sdk' are added, modified, or deleted.
67
+
- If no doc updates are necessary, make no changes and produce no output.
68
+
69
+
# Deliverables when updates occur:
70
+
- Modified documentation files in the working directory only (no commits/pushes/comments).
0 commit comments