Skip to content

Commit ec3a773

Browse files
[feat] Auto-remove claude-review label after CI review completes (#5983)
## Summary Automatically removes the `claude-review` label after the Claude PR review workflow completes, regardless of success or failure. ## Changes - Added a cleanup step to `.github/workflows/claude-pr-review.yml` that removes the label using `gh pr edit --remove-label` - Uses `if: always()` to ensure the label is removed even if the review fails - This prevents label accumulation and allows the label to be re-applied for additional reviews ## Benefits - Cleaner PR label management - Labels can be re-applied to trigger additional reviews without manual cleanup - Reduces noise in the PR interface ## Test Plan - Apply the `claude-review` label to this PR to verify the workflow removes it automatically after completion ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5983-feat-Auto-remove-claude-review-label-after-CI-review-completes-2866d73d365081da929cd393996010e1) by [Unito](https://www.unito.io)
1 parent c56fff0 commit ec3a773

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/claude-pr-review.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ jobs:
7373
with:
7474
label_trigger: "claude-review"
7575
prompt: |
76-
Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
77-
78-
CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
79-
DO NOT create a summary comment.
76+
Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
77+
78+
CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
79+
DO NOT create a summary comment.
8080
Each issue must be posted as a separate inline comment on the specific line of code.
8181
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
8282
claude_args: "--max-turns 256 --allowedTools 'Bash(git:*),Bash(gh api:*),Bash(gh pr:*),Bash(gh repo:*),Bash(jq:*),Bash(echo:*),Read,Write,Edit,Glob,Grep,WebFetch'"
@@ -86,3 +86,9 @@ jobs:
8686
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
8787
BASE_SHA: ${{ github.event.pull_request.base.sha }}
8888
REPOSITORY: ${{ github.repository }}
89+
90+
- name: Remove claude-review label
91+
if: always()
92+
run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "claude-review"
93+
env:
94+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)