-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpr-review-github.yaml
More file actions
54 lines (51 loc) · 1.83 KB
/
pr-review-github.yaml
File metadata and controls
54 lines (51 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
apiVersion: agentic.dev/v0
kind: Workflow
metadata:
name: pr-review-github
spec:
description: |
Live GitHub path: fetch PR JSON and unified diff via the GitHub REST API, run a structured review
with the default project model (OpenAI gpt-4o-mini), then post or update one issue comment on the PR
(comment_strategy replace by default: PATCH existing <!-- agentic-review --> comment or POST once).
The comment step is policy-gated unless you pass --approve for tool.github.pull_request.post_comment
(the bundled Actions PR job passes --approve so a real comment is posted).
Requires GITHUB_TOKEN, OPENAI_API_KEY (for the reviewer agent), and network access to GitHub/OpenAI.
policy: guarded-writes
input:
schema: ./schemas/pr-review-github-input.json
steps:
- id: fetch_pr
uses: tool.github.pull_request.get
with:
owner: ${input.owner}
repo: ${input.repo}
number: ${input.number}
- id: fetch_diff
uses: tool.github.pull_request.diff
with:
owner: ${input.owner}
repo: ${input.repo}
number: ${input.number}
- id: review_diff
agent: reviewer
with:
pull_request: ${steps.fetch_pr.output.pull_request}
diff: ${steps.fetch_diff.output.diff}
- id: post_comment
uses: tool.github.pull_request.post_comment
with:
owner: ${input.owner}
repo: ${input.repo}
number: ${input.number}
comment_strategy: replace
body: |
## Automated review
### Summary
${steps.review_diff.output.summary}
${steps.review_diff.output.findings_markdown}
output:
value:
pull_request: ${steps.fetch_pr.output.pull_request}
diff: ${steps.fetch_diff.output.diff}
review: ${steps.review_diff.output}
comment: ${steps.post_comment.output}