Skip to content

Commit ae7c3f8

Browse files
committed
initial commit
0 parents  commit ae7c3f8

10 files changed

Lines changed: 1084 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Reusable workflow: AI code review.
2+
# Consumers call this via `uses: your-org/ff-sec-action/.github/workflows/ai-code-review.yml@v1`.
3+
# NOTE: the `uses:` ref on the action step below must be kept in sync with release tags
4+
# (reusable workflows cannot reference sibling actions by relative path without a checkout).
5+
name: AI Code Review (reusable)
6+
7+
on:
8+
workflow_call:
9+
inputs:
10+
model:
11+
type: string
12+
required: false
13+
default: claude-opus-4-8
14+
domain:
15+
type: string
16+
required: false
17+
default: filecoin
18+
effort:
19+
type: string
20+
required: false
21+
default: high
22+
max-tokens:
23+
type: string
24+
required: false
25+
default: "16000"
26+
max-diff-bytes:
27+
type: string
28+
required: false
29+
default: "400000"
30+
exclude-pattern:
31+
type: string
32+
required: false
33+
default: ""
34+
fail-on-severity:
35+
type: string
36+
required: false
37+
default: none
38+
post-comment:
39+
type: string
40+
required: false
41+
default: "true"
42+
secrets:
43+
anthropic-api-key:
44+
required: true
45+
outputs:
46+
findings-count:
47+
value: ${{ jobs.review.outputs.findings-count }}
48+
highest-severity:
49+
value: ${{ jobs.review.outputs.highest-severity }}
50+
51+
jobs:
52+
review:
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: read
56+
pull-requests: write
57+
outputs:
58+
findings-count: ${{ steps.ai-review.outputs.findings-count }}
59+
highest-severity: ${{ steps.ai-review.outputs.highest-severity }}
60+
steps:
61+
# No checkout: the action works from the PR diff via the GitHub API and
62+
# never executes PR code.
63+
- name: AI code review
64+
id: ai-review
65+
uses: your-org/ff-sec-action/actions/ai-code-review@v1
66+
with:
67+
anthropic-api-key: ${{ secrets.anthropic-api-key }}
68+
model: ${{ inputs.model }}
69+
domain: ${{ inputs.domain }}
70+
effort: ${{ inputs.effort }}
71+
max-tokens: ${{ inputs.max-tokens }}
72+
max-diff-bytes: ${{ inputs.max-diff-bytes }}
73+
exclude-pattern: ${{ inputs.exclude-pattern }}
74+
fail-on-severity: ${{ inputs.fail-on-severity }}
75+
post-comment: ${{ inputs.post-comment }}

0 commit comments

Comments
 (0)