From 6f412c124d7963ef8b3215724d2b9aecbde4268a Mon Sep 17 00:00:00 2001 From: consultai Date: Wed, 19 Aug 2026 14:16:10 +0700 Subject: [PATCH 1/3] ci: auto-trigger CodeRabbit review on every PR push Repo has <10 GitHub stars, so CodeRabbit's auto-review is skipped with "manual review required for this OSS repository" (Plan: Pro Plus, not a quota issue). This workflow automates the manual trigger by commenting `@coderabbitai review` on PR open/sync/reopen. Test plan: open this PR, observe the workflow post the trigger comment, verify CodeRabbit picks it up. If CodeRabbit ignores github-actions[bot] comments, switch to PAT auth (CR_PAT secret). Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/coderabbit-trigger.yml | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/coderabbit-trigger.yml diff --git a/.github/workflows/coderabbit-trigger.yml b/.github/workflows/coderabbit-trigger.yml new file mode 100644 index 00000000..9ddeaf6d --- /dev/null +++ b/.github/workflows/coderabbit-trigger.yml @@ -0,0 +1,35 @@ +# Auto-trigger CodeRabbit review on every push to a PR. +# Context: repo has <10 GitHub stars, so CodeRabbit's auto-review is skipped +# ("manual review required for this OSS repository"). This workflow automates +# the manual trigger by commenting `@coderabbitai review` on the PR. +# Test: if CodeRabbit ignores github-actions[bot] comments, switch to PAT auth. +name: CodeRabbit auto-trigger + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + +permissions: + pull-requests: write + contents: read + +concurrency: + group: coderabbit-trigger-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + trigger: + # Skip draft PRs (matches .coderabbit.yaml `drafts: false`) + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - name: Trigger CodeRabbit review + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + echo "Triggering CodeRabbit review on PR #$PR_NUMBER ($REPO)" + gh pr comment "$PR_NUMBER" --repo "$REPO" --body "@coderabbitai review" + echo "Comment posted. CodeRabbit should pick it up within ~1-2 min." From ce3a966fe5220a3266701795f50003632e3ee6e2 Mon Sep 17 00:00:00 2001 From: consultai Date: Wed, 19 Aug 2026 14:26:02 +0700 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20use=20PAT=20(AGENT=5FALPHA=20secret)?= =?UTF-8?q?=20instead=20of=20GITHUB=5FTOKEN=20=E2=80=94=20CodeRabbit=20ign?= =?UTF-8?q?ores=20bot=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/coderabbit-trigger.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coderabbit-trigger.yml b/.github/workflows/coderabbit-trigger.yml index 9ddeaf6d..fdb43be9 100644 --- a/.github/workflows/coderabbit-trigger.yml +++ b/.github/workflows/coderabbit-trigger.yml @@ -1,8 +1,8 @@ # Auto-trigger CodeRabbit review on every push to a PR. # Context: repo has <10 GitHub stars, so CodeRabbit's auto-review is skipped # ("manual review required for this OSS repository"). This workflow automates -# the manual trigger by commenting `@coderabbitai review` on the PR. -# Test: if CodeRabbit ignores github-actions[bot] comments, switch to PAT auth. +# the manual trigger by commenting `@coderabbitai review` on the PR as the +# token owner (not github-actions[bot]) — CodeRabbit ignores bot comments. name: CodeRabbit auto-trigger on: @@ -24,12 +24,20 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - name: Trigger CodeRabbit review + - name: Verify PAT secret is set env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CR_PAT: ${{ secrets.AGENT_ALPHA }} + if: ${{ env.CR_PAT == '' }} + run: | + echo "::error::Secret AGENT_ALPHA (PAT) is not set. Add it in repo settings → secrets → actions." + exit 1 + + - name: Trigger CodeRabbit review as token owner + env: + GH_TOKEN: ${{ secrets.AGENT_ALPHA }} PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} run: | - echo "Triggering CodeRabbit review on PR #$PR_NUMBER ($REPO)" + echo "Triggering CodeRabbit review on PR #$PR_NUMBER ($REPO) as token owner" gh pr comment "$PR_NUMBER" --repo "$REPO" --body "@coderabbitai review" - echo "Comment posted. CodeRabbit should pick it up within ~1-2 min." + echo "Comment posted as authenticated user. CodeRabbit should pick it up within ~1-2 min." From 55f9e6c6f8be57683a4b9df99301e973a26d6708 Mon Sep 17 00:00:00 2001 From: consultai Date: Wed, 19 Aug 2026 14:31:06 +0700 Subject: [PATCH 3/3] ci: re-test PAT comment permission