pr-check: Match the full comment for domain comment

This commit is contained in:
bbhtt
2025-08-09 07:14:32 +05:30
parent d55ea885fa
commit a58741e451
+7 -2
View File
@@ -75,6 +75,11 @@ jobs:
echo "$PR_COMMENTS" | grep -Fq "$comment"
}
comment_exists_full() {
local comment="$1"
echo "$PR_COMMENTS" | grep -Fxq "$comment"
}
comment_exists_any() {
for comment in "$@"; do
if echo "$PR_COMMENTS" | grep -Fq "$comment"; then
@@ -110,9 +115,9 @@ jobs:
DOMAIN=$(curl -sSL "$DOMAIN_SCRIPT_URL" | python3 - "$APPID")
if [ "$DOMAIN" != "None" ] && [ -n "$DOMAIN" ]; then
echo "Domain is: $DOMAIN"
if ! comment_exists "$DOMAIN_COMMENT_PARTIAL"; then
DOMAIN_COMMENT="$DOMAIN_COMMENT_PARTIAL $DOMAIN. Please comment if incorrect."
if ! comment_exists_full "$DOMAIN_COMMENT"; then
echo "Did not find domain comment, commenting"
DOMAIN_COMMENT="$DOMAIN_COMMENT_PARTIAL $DOMAIN. Please comment if incorrect."
gh pr comment "$PR_NUM" --body "$DOMAIN_COMMENT"
fi
fi