-
Notifications
You must be signed in to change notification settings - Fork 22
65 lines (58 loc) · 2.4 KB
/
documentation_reviewer.yml
File metadata and controls
65 lines (58 loc) · 2.4 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
55
56
57
58
59
60
61
62
63
64
65
name: Documentation Reviewer
on:
pull_request:
types: [opened, edited, reopened, synchronize]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned, labeled]
pull_request_review:
types: [submitted]
jobs:
claude-response:
runs-on: ubuntu-latest
permissions:
contents: write # Required to read/modify repository files
pull-requests: write # Required to create/modify PRs
issues: write # Required to respond to issues and comments
id-token: write
actions: read # Required for Claude to read CI results
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Ensures the action checks out the PR branch instead of main
ref: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
fetch-depth: 1
- name: Checkout system prompt repository
uses: actions/checkout@v4
with:
repository: netwrix-eng/internal-agents
token: ${{ secrets.PRIVATE_AGENTS_REPO }} # Ensure this secret is in Settings > Secrets
path: system-prompt-repo
ref: main
sparse-checkout: |
agents/engineering/technical_writing/system.md
sparse-checkout-cone-mode: false
- name: Read system prompt
id: read-prompt
run: |
{
echo "prompt<<EOF"
cat system-prompt-repo/agents/engineering/technical_writing/system.md
echo "" # Forces a newline to prevent EOF delimiter errors
echo "EOF"
} >> "$GITHUB_OUTPUT"
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} #
github_token: ${{ secrets.GITHUB_TOKEN }} # Required for Claude to interact with GitHub
# Automated mode: Claude triggers on every PR event with this instruction
prompt: "/review"
# CLI arguments to configure the engine
claude_args: |
--model claude-sonnet-4-5-20250929
--append-system-prompt "${{ steps.read-prompt.outputs.prompt }}"
--allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*),Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"