Skip to content

Add Claude Code GitHub Workflow#308

Merged
appergb merged 3 commits into
mainfrom
add-claude-github-actions-1778120515930
May 7, 2026
Merged

Add Claude Code GitHub Workflow#308
appergb merged 3 commits into
mainfrom
add-claude-github-actions-1778120515930

Conversation

@appergb
Copy link
Copy Markdown
Collaborator

@appergb appergb commented May 7, 2026

User description

🤖 Installing Claude Code GitHub App

This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.

What is Claude Code?

Claude Code is an AI coding agent that can help with:

  • Bug fixes and improvements
  • Documentation updates
  • Implementing new features
  • Code reviews and suggestions
  • Writing tests
  • And more!

How it works

Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.

Important Notes

  • This workflow won't take effect until this PR is merged
  • @claude mentions won't work until after the merge is complete
  • The workflow runs automatically whenever Claude is mentioned in PR or issue comments
  • Claude gets access to the entire PR or issue context including files, diffs, and previous comments

Security

  • Our Anthropic API key is securely stored as a GitHub Actions secret
  • Only users with write access to the repository can trigger the workflow
  • All Claude runs are stored in the GitHub Actions run history
  • Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
  • We can add more allowed tools by adding them to the workflow file like:
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)

There's more information in the Claude Code action repo.

After merging this PR, let's try mentioning @claude in a comment on any PR to get started!


PR Type

Enhancement


Description

  • Add a GitHub Actions workflow for Claude Code integration in .github/workflows/claude.yml.

  • Restrict workflow trigger to only repository OWNERs who mention @claude in comments, reviews, or issues.

  • Implement dynamic model selection: defaults to claude-sonnet-4-6, switches to claude-opus-4-7 if --opus or claude-opus is in the comment.

  • Configure OAuth token secret, permissions, and claude_args for the anthropics/claude-code-action@v1.


Diagram Walkthrough

flowchart LR
  event["Trigger: comment/review/issue contains @claude by OWNER"] -- "author_association == OWNER" --> gate["Owner Gate"]
  gate --> pick["Pick Model: Sonnet (default) or Opus (--opus)"]
  pick --> action["Run anthropics/claude-code-action@v1"]
  action --> output["Claude processes request"]
Loading

File Walkthrough

Relevant files
Enhancement
claude.yml
Add Claude Code workflow with owner gate and model selection

.github/workflows/claude.yml

  • Introduce a new CI workflow for Claude Code.
  • Limit execution to events where an OWNER explicitly mentions @claude.
  • Add a model selection step (Sonnet 4.6 by default, Opus 4.7 opt-in via
    keyword).
  • Set up OAuth token, permissions, and model argument passing for the
    Claude action.
+68/-0   

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

PR Reviewer Guide 🔍

(Review updated until commit 4dc78d9)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

- 删除 claude-code-review.yml:原本 PR opened/sync 自动触发会无差别烧 OAuth 额度
- claude.yml if 加 author_association == 'OWNER' 门禁:只有仓库 owner 评论 @claude 才触发
- 加 Pick model step:默认 claude-sonnet-4-6;评论包含 --opus / claude-opus 时切 claude-opus-4-7
- 用 env 注入 body / title 而不是直接 inline expression,避免外部内容引号注入
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Persistent review updated to latest commit 4dc78d9

@appergb appergb merged commit 32f2df3 into main May 7, 2026
3 checks passed
@appergb appergb deleted the add-claude-github-actions-1778120515930 branch May 10, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant