Skip to content

One workflow run with its jobs: each job's steps and how they went, its annotations (::error:: and the like), and why it stopped.

GET/repos/{owner}/{name}/actions/runs/{id}/attempts/{attempt}

Read a job’s log with get_job_logs. attempts lists every attempt (each re-run is one) with who started it and how it ended; give attempt to read an earlier one, whose jobs keep their own ids and logs.

Each re-run is a new attempt. Read an earlier one with attempt, or at GET /repos/{owner}/{repo}/actions/runs/{id}/attempts/{attempt}; its jobs have ids of their own, so get_job_logs reads the log each had then. A job that is cancelling was cancelled and is running its cleanup steps.

Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
id string Yes The run’s id.
attempt integer Yes An earlier attempt, from 1. The latest if not given.
curl https://api.g1t.sh/repos/flagon-io/hello/actions/runs/run_01kpx7b3c6d9e2f5g8h1j4k7mr/attempts/1 \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"run": {
"id": "run_01kpx7b3c6d9e2f5g8h1j4k7mr",
"workflow_id": "wfl_01kpw2c5d8e1f4g7h0j3k6m9np",
"path": ".g1t/workflows/ci.yml",
"name": "CI",
"title": "Greeting should name the caller",
"number": 12,
"attempt": 1,
"event": "push",
"ref": "refs/heads/main",
"sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13",
"pull": null,
"status": "completed",
"conclusion": "failure",
"error": null,
"actor": "syntaqx",
"created_at": "2026-10-04T15:42:07.318Z",
"started_at": "2026-10-04T15:42:09.020Z",
"finished_at": "2026-10-04T15:44:31.877Z"
},
"jobs": [
{
"id": "job_01kpx7b3d0e4f8g2h6j0k4m8ns",
"run_id": "run_01kpx7b3c6d9e2f5g8h1j4k7mr",
"key": "test",
"name": "test",
"needs": [],
"status": "completed",
"conclusion": "failure",
"steps": [
{
"number": 1,
"name": "Run actions/checkout@v4",
"status": "completed",
"conclusion": "success",
"started_at": "2026-10-04T15:42:10.101Z",
"finished_at": "2026-10-04T15:42:12.433Z"
},
{
"number": 2,
"name": "Run cargo test",
"status": "completed",
"conclusion": "failure",
"started_at": "2026-10-04T15:42:12.440Z",
"finished_at": "2026-10-04T15:44:30.902Z"
}
],
"annotations": [
{
"level": "error",
"message": "assertion failed: greeting names the caller",
"title": "greet",
"file": "src/main.rs",
"line": 41
}
],
"reason": null,
"started_at": "2026-10-04T15:42:09.020Z",
"finished_at": "2026-10-04T15:44:31.002Z"
},
{
"id": "job_01kpx7b3d0e4f8g2h6j0k4m8nt",
"run_id": "run_01kpx7b3c6d9e2f5g8h1j4k7mr",
"key": "deploy",
"name": "deploy",
"needs": [
"test"
],
"status": "completed",
"conclusion": "skipped",
"steps": [],
"annotations": [],
"reason": "A job it needs did not succeed.",
"started_at": null,
"finished_at": "2026-10-04T15:44:31.877Z"
}
],
"notes": [
{
"severity": "unsupported",
"job": "test",
"message": "`services` containers (such as a database) are not started on g1t yet."
}
],
"attempts": [
{
"attempt": 1,
"status": "completed",
"conclusion": "failure",
"actor": "syntaqx",
"debug": false,
"started_at": "2026-10-04T15:42:09.020Z",
"finished_at": "2026-10-04T15:44:31.877Z"
}
]
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
422 invalid The input is not valid. message says which field and why.