pr-check: Don't add duplicate review comments

This commit is contained in:
bbhtt
2025-09-15 07:52:02 +05:30
parent cb8c8f6e45
commit dd8b34945a
+8 -3
View File
@@ -106,6 +106,7 @@ jobs:
CONTAINS_MASTER=$(gh api repos/$GH_REPO/pulls/$PR_NUM/commits --jq '.[1] | (.commit.author.email == "mclasen@redhat.com" and .commit.message == "Add some instructions")')
BLOCKED=0
CHECKLIST_FAILED=0
REVIEW_COMMENT_LINES=()
gh pr view $PR_NUM --json isDraft --jq '.isDraft' | grep -q false && \
@@ -167,11 +168,11 @@ jobs:
if [ "$CHECKLIST_PRESENT" -eq 0 ]; then
echo "No checklist present in PR body"
REVIEW_COMMENT_LINES+=("- All [checklists](https://github.com/flathub/flathub/blob/master/.github/pull_request_template.md?plain=1) are completed")
CHECKLIST_FAILED=1
BLOCKED=1
elif [ "$UNCHECKED" -gt 0 ]; then
echo "Checklist incomplete in PR body"
REVIEW_COMMENT_LINES+=("- All [checklists](https://github.com/flathub/flathub/blob/master/.github/pull_request_template.md?plain=1) are completed")
CHECKLIST_FAILED=1
BLOCKED=1
fi
@@ -180,10 +181,14 @@ jobs:
if [ -z "$REQUIRED_CHECKED" ]; then
echo "Required checklist not found in PR body"
REVIEW_COMMENT_LINES+=("- All [checklists](https://github.com/flathub/flathub/blob/master/.github/pull_request_template.md?plain=1) are completed")
CHECKLIST_FAILED=1
BLOCKED=1
fi
if [ "$CHECKLIST_FAILED" -eq 1 ]; then
REVIEW_COMMENT_LINES+=("- All [checklists](https://github.com/flathub/flathub/blob/master/.github/pull_request_template.md?plain=1) are completed")
fi
echo "BLOCKED is set to $BLOCKED"
if [ "$BLOCKED" -eq 0 ]; then