diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 84984c7..91e7162 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -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