Skip to content

Commit b9296b4

Browse files
authored
Merge pull request #294 from netwrix/dev
field-name flexibility fix and the literal replacement text fix
2 parents 57ca931 + 1092202 commit b9296b4

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,19 @@ jobs:
147147
if not isinstance(s, dict):
148148
print(f"Skipping non-object suggestion: {repr(s)[:100]}")
149149
continue
150-
body = s['body'] + '\n```suggestion\n' + s['suggestion'] + '\n```'
151-
c = {'path': s['path'], 'line': s['line'], 'side': 'RIGHT', 'body': body}
152-
if s.get('start_line') and s['start_line'] != s['line']:
153-
c['start_line'] = s['start_line']
150+
# Accept alternate field names Claude may use
151+
path = s.get('path') or s.get('file')
152+
line = s.get('line') or s.get('line_number')
153+
body_text = s.get('body') or s.get('issue') or s.get('description') or ''
154+
suggestion_text = s.get('suggestion') or s.get('replacement') or s.get('fix') or ''
155+
start_line = s.get('start_line') or s.get('start') or line
156+
if not path or not line or not suggestion_text:
157+
print(f"Skipping incomplete suggestion: {repr(s)[:100]}")
158+
continue
159+
body = body_text + '\n```suggestion\n' + suggestion_text + '\n```'
160+
c = {'path': path, 'line': line, 'side': 'RIGHT', 'body': body}
161+
if start_line and start_line != line:
162+
c['start_line'] = start_line
154163
c['start_side'] = 'RIGHT'
155164
comments.append(c)
156165

0 commit comments

Comments
 (0)