Skip to main content
Möchten Sie das nicht manuell einrichten? Fügen Sie einen Link zu dieser Seite in eine Devin-Sitzung ein und bitten Sie Devin, alles für Sie einzurichten.
1

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:
  1. Go to app.devin.ai > Settings > Service Users and create a service user with ManageOrgSessions permission
  2. Copy the API token shown after creation — it’s only displayed once
  3. In your GitHub repo, navigate to Settings > Secrets and variables > Actions
  4. Add two secrets: DEVIN_API_KEY (the token) and DEVIN_ORG_ID (your organization ID — get it by calling GET https://api.devin.ai/v3/enterprise/organizations with your token)
Stelle sicher, dass das Repository bereits auf Devin’s Machine eingerichtet ist, damit Devin es klonen, bauen und Änderungen pushen kann.
2

Workflow-Datei hinzufügen

Create .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:
Replace "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.
3

What happens when CI fails

When a PR’s CI run fails, the Action extracts failure details and passes them to Devin as a session prompt. Here’s a typical auto-fix flow:
  1. Reads the CI logs — Devin opens the run URL and parses the error output, stack traces, and test results from the failing jobs
  2. Traces the error to code — Locates the relevant file and line on the PR branch (e.g., UserList.tsx:34) and reads the surrounding code and recent diff
  3. Pushes a fix — Commits a targeted change directly to the PR branch, which re-triggers CI automatically
  4. Comments on the PR — Posts a summary explaining the root cause and what was changed
Example PR comment from Devin:
4

Auf die relevanten Fehler eingrenzen

Nicht jeder CI-Fehlschlag lässt sich sinnvoll automatisch beheben – Infrastruktur-Timeouts und Docker-Build-Probleme werden nicht durch eine Code-Änderung gelöst. Fügen Sie eine Bedingung hinzu, sodass nur relevante Jobfehler Devin auslösen:

Korrekturen überprüfbar halten

Devin pusht einen Fix-Commit, aber der PR muss weiterhin von einer Person überprüft werden, bevor er gemergt wird. Automatische Fixes sind als Starthilfe für Entwickler gedacht, nicht als Ersatz für Code-Reviews. Wenn Devin den Fehler nicht beheben kann, hinterlässt es einen Kommentar im PR und erklärt, was es festgestellt hat, damit ein Entwickler von dort übernehmen kann.