Skip to content

Failed CI jobs (GitHub Actions)

You’ll get: an incident when a GitHub Actions workflow fails, with a link back to the run, and automatic resolution the next time it passes.

An ingest key from a generic InfraInbox source, shaped like iik_src_…. Store it as a repository or organization secret, e.g. INFRAINBOX_INGEST_KEY (see Events API: curl and scripts).

Add a step that only runs when an earlier one in the job failed:

- name: Notify InfraInbox on failure
if: failure()
run: |
curl -fsS -m 10 \
-H "Authorization: Bearer ${{ secrets.INFRAINBOX_INGEST_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"title": "${{ github.workflow }} failed on ${{ github.ref_name }}",
"severity": "ERROR",
"type": "ci.failed",
"resource": "workflow:${{ github.workflow }}",
"dedupKey": "gh:${{ github.repository }}:${{ github.workflow }}:${{ github.ref_name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
https://infrainbox.example.com/v1/events

Add a matching step that only runs when the job succeeded:

- name: Resolve InfraInbox incident on success
if: success()
run: |
curl -fsS -m 10 \
-H "Authorization: Bearer ${{ secrets.INFRAINBOX_INGEST_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"title": "${{ github.workflow }} recovered on ${{ github.ref_name }}",
"action": "resolve",
"dedupKey": "gh:${{ github.repository }}:${{ github.workflow }}:${{ github.ref_name }}"
}' \
https://infrainbox.example.com/v1/events

Both steps use the same dedupKey, built from the repository, workflow and branch — that’s what folds repeated failures into one incident and lets a later success close it.

  • Push a commit that breaks the workflow: an incident appears, with a working link back to the failed run.
  • Fix it and push again: the incident resolves on its own the moment the workflow passes.