Skip to content

build(deps): bump tar from 7.4.3 to 7.5.10 #4

build(deps): bump tar from 7.4.3 to 7.5.10

build(deps): bump tar from 7.4.3 to 7.5.10 #4

Workflow file for this run

name: Claude Code with Vertex AI
on:
issue_comment:
types: [created]
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
jobs:
claude:
timeout-minutes: 30
if: contains(github.event.comment.body, '@claude') && github.repository != 'plaidev/karte-react-native'
runs-on: ubuntu-latest
steps:
# コメント内容に基づいてモデルを選択
- name: Select Claude Model
id: select_model
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const comment = context.payload.comment.body;
if (comment.includes('@claude-opus-4')) {
core.setOutput('model', 'claude-opus-4-20250514');
console.log('Using Opus-4 model');
} else {
core.setOutput('model', 'claude-sonnet-4-20250514');
console.log('Using Sonnet-4 model');
}
# リポジトリのチェックアウト
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# GCP認証
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
id: auth_gcp
with:
workload_identity_provider: ${{ secrets.CLAUDE_GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.CLAUDE_GCP_SERVICE_ACCOUNT }}
# Github App Tokenの取得
# secrets.GITHUB_TOKENを使うとcommitした際にCIが走らないため、Github AppのTokenを使用する
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
id: app-token
with:
app-id: ${{ secrets.SHARED_GITHUB_ACTION_AGENT_APP_ID }}
private-key: ${{ secrets.SHARED_GITHUB_ACTION_AGENT_APP_PRIVATE_KEY }}
# Claude Code Actionの実行
- uses: anthropics/claude-code-action@f4d737af0b61a79741d8246c5207da5887746212 # v1.0.15
id: claude_action
continue-on-error: true
env:
# Vertex AI設定
ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.CLAUDE_VERTEX_PROJECT_ID }}
ANTHROPIC_VERTEX_REGION: ${{ secrets.CLAUDE_VERTEX_REGION }}
CLAUDE_CODE_ENDPOINT: vertex
CLOUD_ML_REGION: ${{ secrets.CLAUDE_CLOUD_ML_REGION }}
# モデル設定(動的に選択)
CLAUDE_CODE_PRIMARY_MODEL: ${{ steps.select_model.outputs.model }}
CLAUDE_CODE_ASSISTANT_MODEL: claude-sonnet-4-20250514
# プロンプトキャッシング設定(オプション)
ANTHROPIC_VERTEX_ENABLE_PROMPT_CACHING: true
with:
github_token: ${{ steps.app-token.outputs.token }}
use_vertex: true
direct_prompt: |
@claude メンションのコメントに基づいて対応してください。
コメントは日本語でお願いします。
権限がなくて実現できなかったタスクがある場合は何ができなかったかをコメントしてください。
timeout_minutes: 30
allowed_tools: |
Glob
Grep
LS
Read
# エラー時のコメント
- name: Comment on failure
if: failure() || steps.claude_action.outcome == 'failure'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '❌ Claude Code Actionの実行に失敗しました。\n\n詳細はワークフローログをご確認ください。'
});