Skip to content

fix: add idempotent flag to prevent duplicate Devin sessions #22

fix: add idempotent flag to prevent duplicate Devin sessions

fix: add idempotent flag to prevent duplicate Devin sessions #22

Workflow file for this run

name: Devin CI Fix
on:
workflow_run:
workflows: ["Java CI"]
types: [completed]
jobs:
trigger-devin:
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.head_branch != 'master' &&
!startsWith(github.event.workflow_run.head_branch, 'devin/')
steps:
- name: Call Devin API
run: |
cat > /tmp/devin_payload.json <<'EOF'
{

Check failure on line 20 in .github/workflows/devin-ci-fix.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/devin-ci-fix.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
"prompt": "A CI build failed in the `${{ github.event.repository.full_name }}` repository on the `${{ github.event.workflow_run.head_branch }}` branch. Your task is to fix the build.\n\n- Pull the latest from the `${{ github.event.repository.full_name }}` repository\n- Checkout the `${{ github.event.workflow_run.head_branch }}` branch\n- Run the build locally to reproduce the failure\n- Identify and fix the cause of the build failure\n- Push your changes to the `${{ github.event.workflow_run.head_branch }}` branch\n\nThe CI will automatically run again to verify your fix.",
"title": "Fix CI - ${{ github.event.workflow_run.head_branch }}",
"idempotent": true
}
EOF
curl -X POST https://api.devin.ai/v1/sessions \
-H "Authorization: Bearer ${{ secrets.DEVIN_API_KEY }}" \
-H "Content-Type: application/json" \
-d @/tmp/devin_payload.json