Skip to content

Commit ab89dd9

Browse files
authored
Merge pull request #119 from dexhorthy/base
[robert plant voice] i got a whole lotta diffs
2 parents 81e6ffa + d6433d8 commit ab89dd9

File tree

103 files changed

+11314
-4508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+11314
-4508
lines changed

.cursorrules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

.github/CODEOWNERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CODEOWNERS file for authorized Claude CI users
2+
# This file defines who can trigger Claude workflows via comments and PRs
3+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
4+
5+
# Global owners - these users can trigger Claude workflows
6+
* @dexhorthy @balanceiskey @AdjectiveAllison
7+
8+
# !!claudecode @dexhorthy @balanceiskey @AdjectiveAllison
9+
10+
.github/workflows/ @dexhorthy
11+
.github/CODEOWNERS @dexhorthy

.github/workflows/claude-code-review.yml renamed to .github/workflows/claude-code-review.yml.disabled

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ jobs:
1212
pull-requests: write
1313
issues: write
1414
id-token: write
15-
env:
16-
OVERRIDE_GITHUB_TOKEN: ${{ secrets.CLAUDE_PAT_TOKEN }}
1715
steps:
16+
- name: Check authorization
17+
id: auth-check
18+
run: |
19+
# Get the PR author
20+
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
21+
echo "PR author: $PR_AUTHOR"
22+
23+
# List of authorized users from CODEOWNERS
24+
AUTHORIZED_USERS=$(cat .github/CODEOWNERS | grep !!claudecode | cut -d' ' -f3-)
25+
26+
# Check if user is authorized
27+
if echo "$AUTHORIZED_USERS" | grep -w "$PR_AUTHOR" > /dev/null; then
28+
echo "User $PR_AUTHOR is authorized"
29+
echo "authorized=true" >> $GITHUB_OUTPUT
30+
else
31+
echo "User $PR_AUTHOR is not authorized to trigger Claude workflows"
32+
echo "authorized=false" >> $GITHUB_OUTPUT
33+
fi
1834
# Simply checking out the repository is sufficient - the action handles the PR code
1935
- name: Checkout code
2036
uses: actions/checkout@v4
@@ -23,13 +39,15 @@ jobs:
2339

2440

2541
- name: Run Code Review with Claude
42+
if: steps.auth-check.outputs.authorized == 'true'
2643
uses: anthropics/claude-code-action@beta
27-
env:
28-
OVERRIDE_GITHUB_TOKEN: ${{ secrets.CLAUDE_PAT_TOKEN }}
2944
with:
3045
# Your Anthropic API key
3146
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3247

48+
# GitHub token for API access
49+
github_token: ${{ secrets.CLAUDE_PAT_TOKEN }}
50+
3351
# Direct prompt for Claude to execute
3452
direct_prompt: "Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Pay special attention to Kubernetes operator patterns and Go best practices according to the CLAUDE.md file."
3553

.github/workflows/claude-comment-response.yml renamed to .github/workflows/claude-comment-response.yml.disabled

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,24 @@ jobs:
1414
issues: write
1515
id-token: write
1616
steps:
17-
# Set environment variables for Claude Code Action
18-
- name: Set up environment
17+
- name: Check authorization
18+
id: auth-check
1919
run: |
20-
echo "OVERRIDE_GITHUB_TOKEN=${{ secrets.CLAUDE_PAT_TOKEN }}" >> $GITHUB_ENV
21-
echo "Setting up PAT token for Claude Code Action"
20+
# Get the comment author
21+
COMMENT_AUTHOR="${{ github.event.comment.user.login }}"
22+
echo "Comment author: $COMMENT_AUTHOR"
23+
24+
# List of authorized users from CODEOWNERS
25+
AUTHORIZED_USERS=$(cat .github/CODEOWNERS | grep !!claudecode | cut -d' ' -f3-)
26+
27+
# Check if user is authorized
28+
if echo "$AUTHORIZED_USERS" | grep -w "$COMMENT_AUTHOR" > /dev/null; then
29+
echo "User $COMMENT_AUTHOR is authorized"
30+
echo "authorized=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "User $COMMENT_AUTHOR is not authorized to trigger Claude workflows"
33+
echo "authorized=false" >> $GITHUB_OUTPUT
34+
fi
2235

2336
# Simply checking out the repository is sufficient
2437
- name: Checkout code
@@ -27,14 +40,17 @@ jobs:
2740
fetch-depth: 0 # Get full history for accurate diffs
2841

2942
- name: Claude Response
43+
if: steps.auth-check.outputs.authorized == 'true'
3044
uses: anthropics/claude-code-action@beta
3145
with:
3246
# Your Anthropic API key
3347
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3448

49+
# GitHub token for API access
50+
github_token: ${{ secrets.CLAUDE_PAT_TOKEN }}
51+
3552
# Explicitly set the trigger phrase
3653
trigger_phrase: "@claude"
37-
# Note: Token is provided via OVERRIDE_GITHUB_TOKEN environment variable
3854

3955
# Timeout for execution
4056
timeout_minutes: 20

.github/workflows/claude-pr-creation.yml renamed to .github/workflows/claude-pr-creation.yml.disabled

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ jobs:
1919
issues: write
2020
id-token: write
2121
steps:
22-
# Set environment variables for Claude Code Action
23-
- name: Set up environment
22+
- name: Check authorization
23+
id: auth-check
2424
run: |
25-
echo "OVERRIDE_GITHUB_TOKEN=${{ secrets.CLAUDE_PAT_TOKEN }}" >> $GITHUB_ENV
26-
echo "Setting up PAT token for Claude Code Action"
25+
# Get the comment author
26+
COMMENT_AUTHOR="${{ github.event.comment.user.login }}"
27+
echo "Comment author: $COMMENT_AUTHOR"
28+
29+
# List of authorized users from CODEOWNERS
30+
AUTHORIZED_USERS=$(cat .github/CODEOWNERS | grep !!claudecode | cut -d' ' -f3-)
31+
32+
# Check if user is authorized
33+
if echo "$AUTHORIZED_USERS" | grep -w "$COMMENT_AUTHOR" > /dev/null; then
34+
echo "User $COMMENT_AUTHOR is authorized"
35+
echo "authorized=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "User $COMMENT_AUTHOR is not authorized to trigger Claude workflows"
38+
echo "authorized=false" >> $GITHUB_OUTPUT
39+
fi
2740

2841
# Simply checking out the repository is sufficient
2942
- name: Checkout code
@@ -33,7 +46,7 @@ jobs:
3346

3447
# If running on a PR comment, we need to explicitly check out the PR branch
3548
- name: Checkout PR branch if needed
36-
if: github.event.issue.pull_request
49+
if: github.event.issue.pull_request && steps.auth-check.outputs.authorized == 'true'
3750
run: |
3851
# Get the PR number from the issue object
3952
PR_NUMBER="${{ github.event.issue.number }}"
@@ -53,14 +66,17 @@ jobs:
5366
GITHUB_TOKEN: ${{ secrets.CLAUDE_PAT_TOKEN }}
5467

5568
- name: Claude PR Creation
69+
if: steps.auth-check.outputs.authorized == 'true'
5670
uses: anthropics/claude-code-action@beta
5771
with:
5872
# Your Anthropic API key
5973
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
6074

75+
# GitHub token for API access
76+
github_token: ${{ secrets.CLAUDE_PAT_TOKEN }}
77+
6178
# Explicitly set the trigger phrase
6279
trigger_phrase: "@claude"
63-
# Note: Token is provided via OVERRIDE_GITHUB_TOKEN environment variable
6480

6581
# Timeout for execution (longer for PR creation)
6682
timeout_minutes: 30

.github/workflows/go-ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
path: acp/bin
3434
key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }}
3535

36+
- name: Generate mocks
37+
working-directory: acp
38+
run: make mocks
39+
3640
- name: Install golangci-lint
3741
working-directory: acp
3842
run: make golangci-lint
@@ -71,6 +75,10 @@ jobs:
7175
path: acp/bin
7276
key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }}
7377

78+
- name: Generate mocks
79+
working-directory: acp
80+
run: make mocks
81+
7482
- name: Run tests
7583
working-directory: acp
7684
run: make test
@@ -102,6 +110,10 @@ jobs:
102110
path: acp/bin
103111
key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }}
104112

113+
- name: Generate mocks
114+
working-directory: acp
115+
run: make mocks
116+
105117
- name: Build
106118
working-directory: acp
107119
run: make build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
# Generated files
1010
acp_commands.sh
1111

12+
# Generated kustomization files
13+
acp/config/localdev/kustomization.yaml
14+
15+
acp/config/tmp/

CLAUDE.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)