From 7398afcc9ab94da6c45b397fdc0a87bdcf150640 Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Tue, 25 Jul 2023 09:57:07 -0400 Subject: [PATCH] Instead of looking for a comment that `contains` our signature string, require that it `startswith` that string. (#22047) --- .github/scripts/gh_comment.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/gh_comment.sh b/.github/scripts/gh_comment.sh index b47df541a4..96cd16aaaf 100644 --- a/.github/scripts/gh_comment.sh +++ b/.github/scripts/gh_comment.sh @@ -16,7 +16,8 @@ function update_or_create_comment { -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ --paginate \ - /repos/hashicorp/"$REPO"/issues/"$PR_NUMBER"/comments | jq -r --arg SEARCH_KEY "$SEARCH_KEY" '.[] | select (.body | contains($SEARCH_KEY)) | .id') + /repos/hashicorp/"$REPO"/issues/"$PR_NUMBER"/comments | + jq -r --arg SEARCH_KEY "$SEARCH_KEY" '.[] | select (.body | startswith($SEARCH_KEY)) | .id') if [[ "$comment_id" != "" ]]; then # update the comment with the new body