diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 7d379530fb..f87072843f 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -1,30 +1,20 @@ name: PR Review on: - issue_comment: # Enables /review command in PR comments + pull_request: + types: [opened, ready_for_review] + issue_comment: types: [created] pull_request_review_comment: # Captures feedback on review comments for learning types: [created] pull_request: # Triggers auto-review on PR open (same-repo branches only; fork PRs use /review) types: [ready_for_review, opened] -permissions: - contents: read # Required at top level so `GITHUB_TOKEN` for `issue_comment` events can read repository contents. - jobs: review: - if: >- - github.event_name == 'issue_comment' || - github.event_name == 'pull_request_review_comment' || - github.event.pull_request.user.login != 'dependabot[bot]' - uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1 - # Scoped to the job so other jobs in this workflow aren't over-permissioned + uses: docker/cagent-action/.github/workflows/review-pr.yml@d98096f432f2aea5091c811852c4da804e60623a # v1.4.1 permissions: - contents: read # Read repository files and PR diffs - pull-requests: write # Post review comments and approve/request changes - issues: write # Create security incident issues if secrets are detected in output - checks: write # (Optional) Show review progress as a check run on the PR - secrets: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - CAGENT_ORG_MEMBERSHIP_TOKEN: ${{ secrets.CAGENT_ORG_MEMBERSHIP_TOKEN }} # PAT with read:org scope; gates auto-reviews to org members only - CAGENT_REVIEWER_APP_ID: ${{ secrets.CAGENT_REVIEWER_APP_ID }} # GitHub App ID; reviews appear as your app instead of github-actions[bot] - CAGENT_REVIEWER_APP_PRIVATE_KEY: ${{ secrets.CAGENT_REVIEWER_APP_PRIVATE_KEY }} # GitHub App private key; paired with App ID above + contents: read # to fetch code + pull-requests: write # to post review comments + issues: write # to reply to issue/PR comments + checks: write # to update check statuses + id-token: write # Required for OIDC authentication to AWS Secrets Manager