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)
Add the workflow file
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 会提取失败详情,并将其作为 session 提示传递给 Devin。以下是一个典型的自动修复流程:
- 读取 CI logs — Devin 打开运行 URL,并解析失败 job 中的错误输出、堆栈跟踪和测试结果
- 将错误追踪到代码 — 在 PR 分支上定位相关文件和行 (例如
UserList.tsx:34) ,并读取周边代码及最近的 diff - 推送修复 — 直接向 PR 分支提交有针对性的更改,这会自动重新触发 CI
- 在 PR 上评论 — 发布摘要,说明 root cause 以及做了哪些更改
