Anyone tried using Claude Code GitHub Actions with Z.AI (GLM models)? #673
Replies: 1 comment 1 reply
-
|
Permissions to modify the repo and to add comments to the PR are granted by the official Claude Code GitHub App which you can configure in your repo here. Alternatively, you can create your own GitHub App (see docs) The official Claude Code GitHub App seems to work with the Z.ai GLM Coding Plan and this Claude Code GitHub Action. Please review the Z.ai configuration docs. Specifically: {
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000"
}
}Make sure to add GitHub Action Secrets to your repo for:
I chose to hard code Then you can add a configuration in name: Claude Auto Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
env:
API_TIMEOUT_MS: 3000000
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
Please review this pull request with a focus on:
- Code quality and best practices
- Potential bugs or issues
- Security implications
- Performance considerations
Note: The PR branch is already checked out in the current working directory.
Use `gh pr comment` for top-level feedback.
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues.
Only post GitHub comments - don't submit review text as messages.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"Make sure to have the same Happy coding 🌻 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was reading through the Claude Code GitHub Actions docs and noticed that the officially mentioned backends are the Claude API, AWS Bedrock, and Google Vertex AI.
Meanwhile, Z.AI’s documentation suggests that their GLM models (like GLM-4.6) can be used with Claude Code through an Anthropic API-compatible endpoint — supposedly without changing Claude Code itself.
Any gotchas or tips for configuring Claude Code Actions to point to a custom Anthropic-compatible endpoint?
My goal is to keep using Claude Code GitHub Actions in CI/CD, but with the flexibility to experiment with different LLM providers.
Thanks in advance for any insights!
Beta Was this translation helpful? Give feedback.
All reactions