Merge pull request 'fix: fix: review agent posts duplicate reviews when formal review submission fails (#96)' (#99) from fix/issue-96 into main

This commit is contained in:
johba 2026-03-18 00:34:31 +01:00
commit 5ec587a7b6

View file

@ -117,6 +117,16 @@ status "checking existing reviews"
ALL_COMMENTS=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
"${API_BASE}/issues/${PR_NUMBER}/comments?limit=50")
# Check review-comment watermarks — skip if a comment with <!-- reviewed: SHA --> exists
COMMENT_REVIEWED=$(echo "$ALL_COMMENTS" | \
jq -r --arg sha "$PR_SHA" \
'[.[] | select(.body | contains("<!-- reviewed: " + $sha + " -->"))] | length')
if [ "${COMMENT_REVIEWED:-0}" -gt "0" ] && [ "$FORCE" != "--force" ]; then
log "SKIP: review comment exists for ${PR_SHA:0:7}"
exit 0
fi
# Check formal Codeberg reviews — skip if a non-stale review exists for this SHA
EXISTING=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
"${API_BASE}/pulls/${PR_NUMBER}/reviews" | \