Skip to content

Commit 0f86912

Browse files
committed
chore: update cagent-action to v1.4.1
Signed-off-by: Derek Misler <[email protected]>
1 parent baaaaa3 commit 0f86912

2 files changed

Lines changed: 60 additions & 18 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR Review - Trigger
2+
on:
3+
pull_request:
4+
types: [ready_for_review, opened]
5+
permissions: {}
6+
jobs:
7+
save-pr:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Save PR number
11+
env:
12+
PR_NUMBER: ${{ github.event.pull_request.number }}
13+
run: printf '%s' "$PR_NUMBER" > pr_number.txt
14+
15+
- name: Upload PR context
16+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
17+
with:
18+
name: pr-review-context
19+
path: pr_number.txt
20+
retention-days: 1

.github/workflows/pr-review.yml

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,52 @@
11
name: PR Review
22
on:
3-
issue_comment: # Enables /review command in PR comments
3+
issue_comment: # Enables /review command in PR comments
44
types: [created]
55
pull_request_review_comment: # Captures feedback on review comments for learning
66
types: [created]
7-
pull_request: # Triggers auto-review on PR open (same-repo branches only; fork PRs use /review)
8-
types: [ready_for_review, opened]
7+
workflow_run: # Auto-review for all PRs via artifact handoff (fork and non-fork)
8+
workflows: ["PR Review - Trigger"]
9+
types: [completed]
910

1011
permissions:
11-
contents: read # Required at top level so `GITHUB_TOKEN` for `issue_comment` events can read repository contents.
12+
contents: read # Required at top-level so `issue_comment` events can read repository contents.
1213

1314
jobs:
14-
review:
15-
if: >-
16-
github.event_name == 'issue_comment' ||
17-
github.event_name == 'pull_request_review_comment' ||
18-
github.event.pull_request.user.login != 'dependabot[bot]'
19-
uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
15+
get-pr-context:
16+
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
17+
runs-on: ubuntu-latest
18+
outputs:
19+
pr-number: ${{ steps.pr.outputs.number }}
20+
steps:
21+
- name: Download PR context
22+
if: github.event_name == 'workflow_run'
23+
continue-on-error: true
24+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
25+
with:
26+
name: pr-review-context
27+
run-id: ${{ github.event.workflow_run.id }}
28+
github-token: ${{ github.token }}
29+
30+
- name: Read PR number
31+
id: pr
32+
if: github.event_name == 'workflow_run'
33+
run: echo "number=$(cat pr_number.txt)" >> $GITHUB_OUTPUT
34+
35+
run-docker-agent:
36+
needs: [get-pr-context]
37+
if: |
38+
always() && (
39+
github.event_name == 'issue_comment' ||
40+
github.event_name == 'pull_request_review_comment' ||
41+
needs.get-pr-context.result == 'success'
42+
)
43+
uses: docker/cagent-action/.github/workflows/review-pr.yml@d98096f432f2aea5091c811852c4da804e60623a # v1.4.1
2044
# Scoped to the job so other jobs in this workflow aren't over-permissioned
2145
permissions:
22-
contents: read # Read repository files and PR diffs
46+
contents: read # Read repository files and PR diffs
2347
pull-requests: write # Post review comments and approve/request changes
24-
issues: write # Create security incident issues if secrets are detected in output
25-
checks: write # (Optional) Show review progress as a check run on the PR
26-
secrets:
27-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
28-
CAGENT_ORG_MEMBERSHIP_TOKEN: ${{ secrets.CAGENT_ORG_MEMBERSHIP_TOKEN }} # PAT with read:org scope; gates auto-reviews to org members only
29-
CAGENT_REVIEWER_APP_ID: ${{ secrets.CAGENT_REVIEWER_APP_ID }} # GitHub App ID; reviews appear as your app instead of github-actions[bot]
30-
CAGENT_REVIEWER_APP_PRIVATE_KEY: ${{ secrets.CAGENT_REVIEWER_APP_PRIVATE_KEY }} # GitHub App private key; paired with App ID above
48+
issues: write # Create security incident issues if secrets are detected in output
49+
checks: write # (Optional) Show review progress as a check run on the PR
50+
id-token: write # Required for OIDC authentication to AWS Secrets Manager
51+
with:
52+
pr-number: ${{ needs.get-pr-context.outputs.pr-number }}

0 commit comments

Comments
 (0)