From 28fd6c5c2ef9262b503d8a3bed6199ce479a3f31 Mon Sep 17 00:00:00 2001 From: Neon Date: Thu, 5 Feb 2026 14:15:22 -0800 Subject: [PATCH 1/6] label RTR onl --- .github/workflows/code-review.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index 436a9a5..6cc33ba 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -18,4 +18,5 @@ jobs: with: comment-pr: true upload-results: true - claude-api-key: ${{ secrets.CLAUDE_API_KEY }} \ No newline at end of file + claude-api-key: ${{ secrets.CLAUDE_API_KEY }} + require-label: 'READY TO REVIEW' \ No newline at end of file From fc65e0c8c85fb21fd20d26c9a257190276ccbcfb Mon Sep 17 00:00:00 2001 From: Neon Date: Thu, 5 Feb 2026 14:16:04 -0800 Subject: [PATCH 2/6] update readme as well --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d61aad6..3ccc609 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ jobs: with: comment-pr: true claude-api-key: ${{ secrets.CLAUDE_API_KEY }} + require-label: 'READY TO REVIEW' ``` ## Security Considerations From 0f4a2fa95a1979c822cdd8dcfd97ac848ad9bef0 Mon Sep 17 00:00:00 2001 From: Neon Date: Thu, 5 Feb 2026 14:49:56 -0800 Subject: [PATCH 3/6] only check for label on labeled trigger --- README.md | 2 +- action.yml | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ccc609..a0b2473 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ This action is not hardened against prompt injection attacks and should only be | `custom-security-scan-instructions` | Path to custom security scan instructions text file to append to the security section | None | No | | `dismiss-stale-reviews` | Dismiss previous bot reviews when posting a new review (useful for follow-up commits) | `true` | No | | `skip-draft-prs` | Skip code review on draft pull requests | `true` | No | -| `require-label` | Only run review if this label is present. Leave empty to review all PRs. Add `labeled` to your workflow `pull_request` types to trigger on label addition. | None | No | +| `require-label` | When set, the `labeled` trigger only runs if this specific label was added. Other triggers (`opened`, `synchronize`, `reopened`) always run regardless. Add `labeled` to your workflow `pull_request` types to enable on-demand reviews via label. | None | No | ### Action Outputs diff --git a/action.yml b/action.yml index a77c97a..7b89986 100644 --- a/action.yml +++ b/action.yml @@ -64,7 +64,7 @@ inputs: default: 'true' require-label: - description: 'Only run review if this label is present on the PR. Leave empty to review all PRs. To trigger on label addition, add "labeled" to your workflow pull_request types.' + description: 'When set, the "labeled" trigger will only run if this specific label was added. Other triggers (opened, synchronize, reopened) always run regardless of this setting. Add "labeled" to your workflow pull_request types to enable on-demand reviews via label.' required: false default: '' @@ -113,6 +113,7 @@ runs: IS_DRAFT: ${{ github.event.pull_request.draft }} REQUIRE_LABEL: ${{ inputs.require-label }} PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} + EVENT_ACTION: ${{ github.event.action }} run: | # Check if ClaudeCode should be enabled ENABLE_CLAUDECODE="true" @@ -123,12 +124,13 @@ runs: PR_NUMBER="$PR_NUMBER" CACHE_HIT="${{ steps.claudecode-history.outputs.cache-hit }}" - # Check if required label is present - if [ -n "$REQUIRE_LABEL" ]; then + # Check label requirement only for 'labeled' trigger + # Other triggers (opened, synchronize, reopened) run without label check + if [ "$EVENT_ACTION" == "labeled" ] && [ -n "$REQUIRE_LABEL" ]; then if echo "$PR_LABELS" | jq -e --arg label "$REQUIRE_LABEL" 'index($label) != null' > /dev/null 2>&1; then - echo "Required label '$REQUIRE_LABEL' found on PR #$PR_NUMBER" + echo "Required label '$REQUIRE_LABEL' found on PR #$PR_NUMBER (triggered by label addition)" else - echo "Skipping code review: required label '$REQUIRE_LABEL' not found on PR #$PR_NUMBER" + echo "Skipping code review: 'labeled' trigger requires label '$REQUIRE_LABEL', but it was not the label added" ENABLE_CLAUDECODE="false" fi fi From ddfca16973755f5c06413372808aa1ae1ccb5014 Mon Sep 17 00:00:00 2001 From: Neon Date: Fri, 6 Feb 2026 07:08:11 -0800 Subject: [PATCH 4/6] Revert "only check for label on labeled trigger" This reverts commit 0f4a2fa95a1979c822cdd8dcfd97ac848ad9bef0. --- README.md | 2 +- action.yml | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a0b2473..3ccc609 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ This action is not hardened against prompt injection attacks and should only be | `custom-security-scan-instructions` | Path to custom security scan instructions text file to append to the security section | None | No | | `dismiss-stale-reviews` | Dismiss previous bot reviews when posting a new review (useful for follow-up commits) | `true` | No | | `skip-draft-prs` | Skip code review on draft pull requests | `true` | No | -| `require-label` | When set, the `labeled` trigger only runs if this specific label was added. Other triggers (`opened`, `synchronize`, `reopened`) always run regardless. Add `labeled` to your workflow `pull_request` types to enable on-demand reviews via label. | None | No | +| `require-label` | Only run review if this label is present. Leave empty to review all PRs. Add `labeled` to your workflow `pull_request` types to trigger on label addition. | None | No | ### Action Outputs diff --git a/action.yml b/action.yml index 7b89986..a77c97a 100644 --- a/action.yml +++ b/action.yml @@ -64,7 +64,7 @@ inputs: default: 'true' require-label: - description: 'When set, the "labeled" trigger will only run if this specific label was added. Other triggers (opened, synchronize, reopened) always run regardless of this setting. Add "labeled" to your workflow pull_request types to enable on-demand reviews via label.' + description: 'Only run review if this label is present on the PR. Leave empty to review all PRs. To trigger on label addition, add "labeled" to your workflow pull_request types.' required: false default: '' @@ -113,7 +113,6 @@ runs: IS_DRAFT: ${{ github.event.pull_request.draft }} REQUIRE_LABEL: ${{ inputs.require-label }} PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} - EVENT_ACTION: ${{ github.event.action }} run: | # Check if ClaudeCode should be enabled ENABLE_CLAUDECODE="true" @@ -124,13 +123,12 @@ runs: PR_NUMBER="$PR_NUMBER" CACHE_HIT="${{ steps.claudecode-history.outputs.cache-hit }}" - # Check label requirement only for 'labeled' trigger - # Other triggers (opened, synchronize, reopened) run without label check - if [ "$EVENT_ACTION" == "labeled" ] && [ -n "$REQUIRE_LABEL" ]; then + # Check if required label is present + if [ -n "$REQUIRE_LABEL" ]; then if echo "$PR_LABELS" | jq -e --arg label "$REQUIRE_LABEL" 'index($label) != null' > /dev/null 2>&1; then - echo "Required label '$REQUIRE_LABEL' found on PR #$PR_NUMBER (triggered by label addition)" + echo "Required label '$REQUIRE_LABEL' found on PR #$PR_NUMBER" else - echo "Skipping code review: 'labeled' trigger requires label '$REQUIRE_LABEL', but it was not the label added" + echo "Skipping code review: required label '$REQUIRE_LABEL' not found on PR #$PR_NUMBER" ENABLE_CLAUDECODE="false" fi fi From dfd339165646df296b5515d7fb758619e38dc731 Mon Sep 17 00:00:00 2001 From: Neon Date: Fri, 6 Feb 2026 07:11:31 -0800 Subject: [PATCH 5/6] leave disabled in this workflow for debug --- .github/workflows/code-review.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index 6cc33ba..e1a834e 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -19,4 +19,3 @@ jobs: comment-pr: true upload-results: true claude-api-key: ${{ secrets.CLAUDE_API_KEY }} - require-label: 'READY TO REVIEW' \ No newline at end of file From a9d893b13523954546aee84b9d0d2dfd9448b98b Mon Sep 17 00:00:00 2001 From: Neon Date: Fri, 6 Feb 2026 07:12:24 -0800 Subject: [PATCH 6/6] readme update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ccc609..32f8b24 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ jobs: with: comment-pr: true claude-api-key: ${{ secrets.CLAUDE_API_KEY }} - require-label: 'READY TO REVIEW' + require-label: 'READY TO REVIEW' # If this isn't set, the action will trigger any time *any* label is applied ``` ## Security Considerations