From 636d37b39ca26a70e228fb7f3aa90400f3671115 Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Fri, 13 Feb 2026 19:24:14 +0000 Subject: [PATCH 1/3] fix(prompts): use dynamic bot identity for comment filtering Query bot identity at runtime via `gh api user` instead of hardcoding `claude[bot]`. This ensures comment cleanup works regardless of which bot name is configured in the action inputs. --- .github/prompts/shared/03-comment-hygiene.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/prompts/shared/03-comment-hygiene.md b/.github/prompts/shared/03-comment-hygiene.md index 3fd22f1..ae6e8cd 100644 --- a/.github/prompts/shared/03-comment-hygiene.md +++ b/.github/prompts/shared/03-comment-hygiene.md @@ -6,12 +6,18 @@ outdated text visible on the PR timeline. ### 0a. List everything you previously posted -Run all three: +First, get your own bot identity: ```sh -gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq '.[] | select(.user.login == "claude[bot]") | {id, state, body}' -gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq '.[] | select(.user.login == "claude[bot]") | {id, path, body}' -gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq '.[] | select(.user.login == "claude[bot]") | {id, body}' +BOT_LOGIN=$(gh api user --jq '.login') +``` + +Then list your previous activity: + +```sh +gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, state, body}" +gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, path, body}" +gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, body}" ``` Also list reviews and comments from other authors so you understand context — From 0541122ed4b7418f3b6ba5f4f46c6848b13f38ab Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Fri, 13 Feb 2026 19:33:44 +0000 Subject: [PATCH 2/3] fix: use GraphQL viewer query instead of REST API --- .github/prompts/shared/03-comment-hygiene.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/prompts/shared/03-comment-hygiene.md b/.github/prompts/shared/03-comment-hygiene.md index ae6e8cd..65a9f96 100644 --- a/.github/prompts/shared/03-comment-hygiene.md +++ b/.github/prompts/shared/03-comment-hygiene.md @@ -9,7 +9,7 @@ outdated text visible on the PR timeline. First, get your own bot identity: ```sh -BOT_LOGIN=$(gh api user --jq '.login') +BOT_LOGIN=$(gh api graphql -f query='{ viewer { login } }' --jq '.data.viewer.login') ``` Then list your previous activity: From 67b7d705adff7b478d3133c3a91211786dd27b20 Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Fri, 13 Feb 2026 19:38:29 +0000 Subject: [PATCH 3/3] feat: list all feedback to avoid duplicating others' comments --- .github/prompts/shared/03-comment-hygiene.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/prompts/shared/03-comment-hygiene.md b/.github/prompts/shared/03-comment-hygiene.md index 65a9f96..9002a86 100644 --- a/.github/prompts/shared/03-comment-hygiene.md +++ b/.github/prompts/shared/03-comment-hygiene.md @@ -4,7 +4,7 @@ feedback.** Skipping cleanup leaves stale comments and dismissed reviews with outdated text visible on the PR timeline. -### 0a. List everything you previously posted +### 0a. List all existing feedback First, get your own bot identity: @@ -12,7 +12,16 @@ First, get your own bot identity: BOT_LOGIN=$(gh api graphql -f query='{ viewer { login } }' --jq '.data.viewer.login') ``` -Then list your previous activity: +List **all** reviews and comments to understand context and avoid duplicating +feedback from others: + +```sh +gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq '.[] | {user: .user.login, state, body}' +gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq '.[] | {user: .user.login, path, body}' +gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq '.[] | {user: .user.login, body}' +``` + +Identify your own previous activity (these are the only items you can modify): ```sh gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, state, body}" @@ -20,8 +29,7 @@ gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq ".[] | select(.user.login gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, body}" ``` -Also list reviews and comments from other authors so you understand context — -but never modify items you did not author. +Do not modify items you did not author. ### 0b. Clean up stale reviews