From 9c2ee5e87000dfa0a339cae2bd265de90f4d36b9 Mon Sep 17 00:00:00 2001 From: Jason Pascucci Date: Tue, 17 Nov 2026 08:18:24 -0800 Subject: [PATCH] CI: restrict preview comment cleanup to the bot author closes #3484 The cleanup script matches comments by their sticky preview marker alone. A later comment quoting that marker can be selected instead of the bot's preview comment, causing cleanup to target the wrong comment and leave the preview link unchanged. Also require the comment author to be github-actions[bot], consistent with the sticky-comment action's lookup. --- ci/cleanup-pr-previews | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cleanup-pr-previews b/ci/cleanup-pr-previews index 414e8507ad3..d8bbd571cdc 100755 --- a/ci/cleanup-pr-previews +++ b/ci/cleanup-pr-previews @@ -122,7 +122,7 @@ update_preview_comment() { printf -v comment_body 'Doc Preview CI\n:---:\n%s\n' "$status_message" if ! comment_id=$(gh api --paginate repos/"${REPOSITORY}"/issues/"${pr_number}"/comments \ --header "Accept: application/vnd.github+json" \ - --jq '.[] | select(.body | contains("")) | .id' \ + --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains(""))) | .id' \ | tail -n 1); then return 1 fi