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
if [ -n "$IN_REPLY_TO" ] && [ "$IN_REPLY_TO" != "0" ]; then
71
-
PARENT_BODY=$(gh api repos/${{ github.repository }}/pulls/comments/$IN_REPLY_TO --jq '.body')
72
-
else
73
-
PARENT_BODY="$COMMENT_BODY"
74
-
fi
47
+
- name: Checkout system prompt repository
48
+
if: steps.pr-info.outputs.is_fork == 'false'
49
+
uses: actions/checkout@v4
50
+
with:
51
+
repository: netwrix-eng/internal-agents
52
+
token: ${{ secrets.PRIVATE_AGENTS_REPO }}
53
+
path: system-prompt-repo
54
+
ref: builds
55
+
sparse-checkout: |
56
+
engineering/technical_writing/system-prompt.md
57
+
sparse-checkout-cone-mode: false
75
58
59
+
- name: Read system prompt
60
+
id: read-prompt
61
+
if: steps.pr-info.outputs.is_fork == 'false'
62
+
run: |
76
63
{
77
64
echo "prompt<<EOF"
78
-
echo "The user replied to an inline review comment on PR #${{ steps.pr-info.outputs.number }}."
79
-
echo ""
80
-
echo "User's reply: $COMMENT_BODY"
81
-
echo ""
82
-
echo "Parent inline comment:"
83
-
echo "$PARENT_BODY"
84
-
echo ""
85
-
echo "File: \`$FILE_PATH\`, line: $LINE."
86
-
echo ""
87
-
echo "Based on the user's reply:"
88
-
echo "- If they asked to apply the suggestion: extract the text from the 'Suggested change:' code block in the parent comment. Open \`$FILE_PATH\`, replace the content at line $LINE with that text, then stage, commit, and push the change."
89
-
echo "- If they asked to add the suggestion to a batch: find or create a PR comment from github-actions[bot] that starts with '<!-- CLAUDE-BATCH-TRACKER -->'. Add this suggestion to the list and rewrite the comment using exactly this format (replacing N with the updated count and updating the list):"
90
-
echo ""
91
-
echo " <!-- CLAUDE-BATCH-TRACKER -->"
92
-
echo " **Batched suggestions: N**"
93
-
echo " Comment \`@claude apply batch\` on this PR to apply all of them."
echo " Then post a reply to the inline comment thread: 'Added to batch (N total). Comment \`@claude apply batch\` on this PR to apply all batched suggestions.'"
Copy file name to clipboardExpand all lines: .github/workflows/claude-documentation-reviewer.yml
+11-29Lines changed: 11 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -89,25 +89,16 @@ jobs:
89
89
90
90
Follow these steps in order:
91
91
92
-
1. Use the Read tool to read each file in full. Do not look at the PR diff yet.
92
+
1. Use `gh pr diff ${{ github.event.pull_request.number }}` to get the lines that were added or modified in this PR.
93
93
94
-
2. Identify ALL issues in the document per your instructions.
94
+
2. Review ONLY the added or modified lines from the diff for issues per your instructions. Do not report issues on lines that were not changed.
95
95
96
-
3. Use `gh pr diff ${{ github.event.pull_request.number }}` to get the list of lines that were added or modified in this PR.
97
-
98
-
4. Categorize each issue from step 2 as either:
99
-
- Issues in PR changes: the issue is on a line that was added or modified in this PR
100
-
- Preexisting issues: the issue exists on a line that was not changed by this PR
101
-
102
-
You MUST write your complete review to `/tmp/review-summary.md` — always, even if there are no issues. Use this exact structure — two sections, each containing a flat list of issues in the format from your instructions, with no subheadings, groupings, or extra nesting:
96
+
3. You MUST write your complete review to `/tmp/review-summary.md` — always, even if there are no issues. Use this exact structure — a flat list of issues in the format from your instructions, with no subheadings, groupings, or extra nesting:
103
97
104
98
## Issues in PR changes
105
99
<flat list of issues in the format from your instructions, or "None." if there are none>
106
100
107
-
## Preexisting issues
108
-
<flat list of issues in the format from your instructions, or "None." if there are none>
109
-
110
-
Then fix ALL issues directly in the files using the Write and Edit tools. Do not post a PR comment. Do not commit or push.
101
+
4. Fix ALL issues directly in the files using the Write and Edit tools. Do not post a PR comment. Do not commit or push.
111
102
112
103
claude_args: |
113
104
--model claude-sonnet-4-5-20250929
@@ -132,24 +123,15 @@ jobs:
132
123
133
124
FOOTER = (
134
125
"\n---\n\n"
135
-
"To apply individual fixes, reply to the inline comments on this review"
136
-
" with `@claude apply suggestion`.\n"
137
-
"To batch fixes, reply with `@claude add suggestion to batch` on each inline comment,"
138
-
" then comment `@claude apply batch` on this PR when ready.\n"
139
-
"To fix issues in bulk, reply with `@claude` here, followed by your instructions"
140
-
" (e.g. `@claude fix all issues` or `@claude fix only the spelling errors`"
141
-
" or `@claude fix all other existing issues`"
142
-
" or `@claude fix all linting issues`)."
143
-
" You can use this option to fix preexisting issues.\n\n"
126
+
"To apply suggested fixes to the updated documentation, individually or in bulk, comment `@claude`"
127
+
" on this PR followed by your instructions (`@claude fix all issues`"
128
+
" or `@claude fix all linting issues` or `@claude fix only the spelling errors`).\n\n"
129
+
"To review and fix other preexisting issues in the updated documentation, comment `@claude` on this PR"
130
+
" followed by your instructions (`@claude review preexisting issues`"
131
+
" or `@claude fix preexisting issues`).\n\n"
144
132
"Note: Automated fixes are only available for branches in this repository, not forks."
145
133
)
146
134
147
-
INLINE_FOOTER = (
148
-
"\n\n---\n\n"
149
-
"Reply with `@claude`, followed by your instructions"
150
-
" (e.g. `@claude apply suggestion` or `@claude add suggestion to batch`)."
151
-
)
152
-
153
135
def parse_diff_to_suggestions(diff_text):
154
136
suggestions = []
155
137
current_file = None
@@ -226,7 +208,7 @@ jobs:
226
208
return None # Pure insertions cannot be placed as inline comments
0 commit comments