Documentation Index
Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
Use this file to discover all available pages before exploring further.
Store your Devin API key in GitHub
The workflow calls Devin’s v3 API to create sessions programmatically. Create a service user and store its token as a GitHub Actions secret:
- Go to app.devin.ai > Settings > Service Users and create a service user with
ManageOrgSessionspermission - Copy the API token shown after creation — it’s only displayed once
- In your GitHub repo, navigate to Settings > Secrets and variables > Actions
- Add two secrets:
DEVIN_API_KEY(the token) andDEVIN_ORG_ID(your organization ID — get it by callingGET https://api.devin.ai/v3/enterprise/organizationswith your token)
ワークフローファイルを追加する
Create Replace
.github/workflows/devin-ci-fix.yml. This workflow fires whenever your existing CI workflow completes with a failure, extracts the failing job names, and calls the Devin API to start a fix session:"CI" in the workflows array with the exact name: from your existing CI workflow file (e.g., "Tests", "Build & Test").Use the tags field in the request body (e.g., "tags": ["ci-fix", "pr-312"]) to track which CI failures have already triggered sessions and avoid duplicates.What happens when CI fails
PR の CI 実行が失敗すると、Action が失敗の詳細を抽出し、セッションプロンプトとして Devin に渡します。以下は、典型的な自動修正のフローです。
- CI ログを読み取る — Devin が実行 URL を開き、失敗したジョブのエラー出力、スタックトレース、テスト結果を解析します
- エラーをコードまでたどる — PR ブランチ上の関連するファイルと行 (例:
UserList.tsx:34) を特定し、その周辺コードと直近の差分を読み取ります - 修正をプッシュする — 狙いを絞った変更を PR ブランチに直接コミットし、これにより CI が自動的に再トリガーされます
- PR にコメントする — root cause と変更内容を説明する要約を投稿します
対象を適切な失敗に絞る
すべての CI の失敗が自動修正の恩恵を受けられるわけではありません。インフラのタイムアウトや Docker ビルドの問題は、コード変更では解決できません。関連するジョブの失敗のときにだけ Devin がトリガーされるよう、条件を追加してください。
