Skip to content

Commit 5ce23fb

Browse files
authored
Merge pull request #359 from netwrix/dev
normalize heading-format issues
2 parents 3db86ec + 6985cda commit 5ce23fb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/claude-documentation-reviewer.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,23 @@ jobs:
250250
# '-' lines don't exist in HEAD, skip
251251
return valid
252252
253+
def normalize_review_body(body):
254+
"""Convert any heading-formatted issue lines to bullet points."""
255+
lines = []
256+
for line in body.split('\n'):
257+
# Convert "### Line N: ..." or "#### Line N: ..." etc. to "- Line N: ..."
258+
m = re.match(r'^#{1,6}\s+(Line \d+:.+)$', line)
259+
if m:
260+
lines.append(f'- {m.group(1)}')
261+
else:
262+
lines.append(line)
263+
return '\n'.join(lines)
264+
253265
# Read the review summary Claude wrote
254266
summary_path = '/tmp/review-summary.md'
255267
if os.path.exists(summary_path):
256268
with open(summary_path) as f:
257-
review_body = f.read().strip()
269+
review_body = normalize_review_body(f.read().strip())
258270
else:
259271
review_body = '## Documentation Review\n\nNo summary was generated.'
260272

0 commit comments

Comments
 (0)