From c31d5c8ddc2e45d0f5f640aefc758f16665e9f37 Mon Sep 17 00:00:00 2001 From: Chris Calo Date: Sun, 16 Nov 2025 23:03:32 -0500 Subject: [PATCH 1/4] Add Claude Code GitHub Action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the Claude Code GitHub Action to enable @claude mentions in issues and PRs. 🤖 Generated with automated setup --- .github/workflows/claude.yaml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/claude.yaml diff --git a/.github/workflows/claude.yaml b/.github/workflows/claude.yaml new file mode 100644 index 0000000..aedb2e2 --- /dev/null +++ b/.github/workflows/claude.yaml @@ -0,0 +1,58 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + id-token: write + actions: read # Required for Claude to read CI results on PRs + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + + # Optional: Customize the trigger phrase (default: @claude) + # trigger_phrase: "/claude" + + # Optional: Trigger when specific user is assigned to an issue + # assignee_trigger: "claude-bot" + + # Optional: Configure Claude's behavior with CLI arguments + # claude_args: | + # --model claude-opus-4-1-20250805 + # --max-turns 10 + # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" + # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." + + # Optional: Advanced settings configuration + # settings: | + # { + # "env": { + # "NODE_ENV": "test" + # } + # } From ddbccdf95ecd4be4b1529f511aa76037e6064788 Mon Sep 17 00:00:00 2001 From: Chris Calo Date: Sun, 16 Nov 2025 23:46:48 -0500 Subject: [PATCH 2/4] Enable full Bash(*) access for Claude --- .github/workflows/claude.yaml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/claude.yaml b/.github/workflows/claude.yaml index aedb2e2..011087b 100644 --- a/.github/workflows/claude.yaml +++ b/.github/workflows/claude.yaml @@ -33,26 +33,11 @@ jobs: - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - # Optional: Customize the trigger phrase (default: @claude) - # trigger_phrase: "/claude" - - # Optional: Trigger when specific user is assigned to an issue - # assignee_trigger: "claude-bot" - - # Optional: Configure Claude's behavior with CLI arguments - # claude_args: | - # --model claude-opus-4-1-20250805 - # --max-turns 10 - # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" - # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." - - # Optional: Advanced settings configuration - # settings: | - # { - # "env": { - # "NODE_ENV": "test" - # } - # } + # Enable full bash access for Claude + claude_args: | + --allowedTools "Bash(*)" From 1637c3e9123c3b24e6b6736b83be7fb6b7e8ab34 Mon Sep 17 00:00:00 2001 From: Chris Calo Date: Mon, 17 Nov 2025 00:05:11 -0500 Subject: [PATCH 3/4] Update Claude workflow to use author_association OWNER check --- .github/workflows/claude.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude.yaml b/.github/workflows/claude.yaml index 011087b..4246a47 100644 --- a/.github/workflows/claude.yaml +++ b/.github/workflows/claude.yaml @@ -13,10 +13,13 @@ on: jobs: claude: if: | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event.comment.author_association == 'OWNER' || + github.event.review.author_association == 'OWNER' || + github.event.issue.author_association == 'OWNER') && + ((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))) runs-on: ubuntu-latest permissions: contents: write From 1f9864f92423889c510b779baad34dbe2c66c6e6 Mon Sep 17 00:00:00 2001 From: Chris Calo Date: Mon, 17 Nov 2025 01:33:47 -0500 Subject: [PATCH 4/4] Improve workflow conditional formatting for readability --- .github/workflows/claude.yaml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/claude.yaml b/.github/workflows/claude.yaml index 4246a47..4fb6197 100644 --- a/.github/workflows/claude.yaml +++ b/.github/workflows/claude.yaml @@ -12,14 +12,32 @@ on: jobs: claude: + # Only run if: 1) User is OWNER, and 2) Message contains @claude if: | - (github.event.comment.author_association == 'OWNER' || - github.event.review.author_association == 'OWNER' || - github.event.issue.author_association == 'OWNER') && - ((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))) + ( + github.event.comment.author_association == 'OWNER' || + github.event.review.author_association == 'OWNER' || + github.event.issue.author_association == 'OWNER' + ) && ( + ( + github.event_name == 'issue_comment' && + contains(github.event.comment.body, '@claude') + ) || + ( + github.event_name == 'pull_request_review_comment' && + contains(github.event.comment.body, '@claude') + ) || + ( + github.event_name == 'pull_request_review' && + contains(github.event.review.body, '@claude') + ) || + ( + github.event_name == 'issues' && ( + contains(github.event.issue.body, '@claude') || + contains(github.event.issue.title, '@claude') + ) + ) + ) runs-on: ubuntu-latest permissions: contents: write