-
Notifications
You must be signed in to change notification settings - Fork 120
54 lines (44 loc) · 1.5 KB
/
audit.yml
File metadata and controls
54 lines (44 loc) · 1.5 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
name: Repo Audit
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am UTC
workflow_dispatch: # Manual trigger
permissions:
contents: write
pull-requests: write
jobs:
audit:
name: Audit repo health
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- name: Check for API key
id: check-key
run: |
if [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
echo "has_key=false" >> "$GITHUB_OUTPUT"
echo "::warning::ANTHROPIC_API_KEY secret is not set. Add it to repo secrets to enable automated audits. Go to Settings → Secrets → Actions → New repository secret."
else
echo "has_key=true" >> "$GITHUB_OUTPUT"
fi
- name: Install Claude Code
if: steps.check-key.outputs.has_key == 'true'
run: npm install -g @anthropic-ai/claude-code
- name: Install pnpm
if: steps.check-key.outputs.has_key == 'true'
uses: pnpm/action-setup@v4
- name: Set up Node
if: steps.check-key.outputs.has_key == 'true'
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install dependencies
if: steps.check-key.outputs.has_key == 'true'
run: pnpm install --frozen-lockfile
- name: Run audit
if: steps.check-key.outputs.has_key == 'true'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: ./scripts/audit-repo.sh --pr