Skip to content

Commit f5c1540

Browse files
anakrishCopilot
andcommitted
fix: use VALID_ANCHORS_PLAIN for anchor validation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6a6869f commit f5c1540

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/scripts/perspective-review.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ CONTEXT_SUMMARY=$(awk -F: '
130130
$3 == "context" { print $1 ":" $2 }
131131
' /tmp/valid_anchors_full.txt | head -50)
132132

133+
# Plain file:line list for validation
134+
VALID_ANCHORS_PLAIN=$(cat /tmp/valid_anchors.txt)
135+
133136
# Step 5: Review with each perspective, posting one PR review per perspective
134137
TOTAL_FINDINGS=0
135138

@@ -243,13 +246,13 @@ PROMPT
243246

244247
# Separate findings into anchored (inline) and unanchored (body-only)
245248
# Validate each finding's file:line against the valid anchors list
246-
INLINE_COMMENTS=$(echo "$CONTENT" | jq -c --arg anchors "$ANCHOR_LIST" '
249+
INLINE_COMMENTS=$(echo "$CONTENT" | jq -c --arg anchors "$VALID_ANCHORS_PLAIN" '
247250
($anchors | split("\n") | map(select(. != ""))) as $valid |
248251
[.[] | select(.file != null and .line != null) |
249252
select((.file + ":" + (.line | tostring)) as $key | $valid | any(. == $key))]
250253
' 2>/dev/null || echo "[]")
251254

252-
UNANCHORED=$(echo "$CONTENT" | jq -c --arg anchors "$ANCHOR_LIST" '
255+
UNANCHORED=$(echo "$CONTENT" | jq -c --arg anchors "$VALID_ANCHORS_PLAIN" '
253256
($anchors | split("\n") | map(select(. != ""))) as $valid |
254257
[.[] | select(
255258
.file == null or .line == null or

0 commit comments

Comments
 (0)