|
| 1 | +name: PR Review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request_target: |
| 5 | + types: [opened, ready_for_review] |
| 6 | + issue_comment: |
| 7 | + types: [created] |
| 8 | + pull_request_review_comment: |
| 9 | + types: [created] |
| 10 | + |
| 11 | +# Serialize reviews per PR; do not cancel in-progress runs |
| 12 | +# so no review is silently dropped mid-execution. |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }} |
| 15 | + cancel-in-progress: false |
| 16 | + |
| 17 | +jobs: |
| 18 | + review: |
| 19 | + # Only run on the upstream repo (not forks) to prevent credential leaks. |
| 20 | + # Skip draft PRs (ready_for_review will fire when promoted). |
| 21 | + # Skip bot actors to avoid reviewing Dependabot and automation PRs. |
| 22 | + # Require collaborator-level access for comment-triggered events. |
| 23 | + # Only trigger on PR comments, not plain issue comments. |
| 24 | + if: >- |
| 25 | + github.repository == 'docker/compose' && |
| 26 | + (github.event_name != 'pull_request_target' || github.event.pull_request.draft == false) && |
| 27 | + (github.event_name == 'pull_request_target' || |
| 28 | + (github.event_name == 'issue_comment' && |
| 29 | + github.event.issue.pull_request && |
| 30 | + contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || |
| 31 | + (github.event_name == 'pull_request_review_comment' && |
| 32 | + contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))) && |
| 33 | + !endsWith(github.actor, '[bot]') |
| 34 | + uses: docker/cagent-action/.github/workflows/review-pr.yml@3a12dbd0c6cd7dda3d4e05f24f0143c9701456de # v1.2.13 |
| 35 | + secrets: |
| 36 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 37 | + CAGENT_ORG_MEMBERSHIP_TOKEN: ${{ secrets.CAGENT_ORG_MEMBERSHIP_TOKEN }} |
| 38 | + CAGENT_REVIEWER_APP_ID: ${{ secrets.CAGENT_REVIEWER_APP_ID }} |
| 39 | + CAGENT_REVIEWER_APP_PRIVATE_KEY: ${{ secrets.CAGENT_REVIEWER_APP_PRIVATE_KEY }} |
| 40 | + permissions: |
| 41 | + contents: read # to fetch code |
| 42 | + pull-requests: write # to post review comments |
| 43 | + issues: write # to reply to issue/PR comments |
| 44 | + checks: write # to update check statuses |
0 commit comments