Instead of looking for a comment that contains our signature string, require that it startswith that string. (#22047)

This commit is contained in:
Nick Cabatoff 2023-07-25 09:57:07 -04:00 committed by GitHub
parent 2754ce1987
commit 7398afcc9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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