actionsListJobsForWorkflowRunAttempt
List jobs for a workflow run attempt
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs - Operation ID:
actions/list-jobs-for-workflow-run-attempt
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"run_id": {
"description": "The unique identifier of the workflow run.",
"required": true,
"location": "path",
"type": "integer"
},
"attempt_number": {
"description": "The attempt number of the workflow run.",
"required": true,
"location": "path",
"type": "integer"
},
"per_page": {
"description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
"required": false,
"location": "query",
"type": "integer"
},
"page": {
"description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
"required": false,
"location": "query",
"type": "integer"
}
}Response Schema
{
"type": "object",
"required": [
"total_count",
"jobs"
],
"properties": {
"total_count": {
"type": "integer"
},
"jobs": {
"type": "array",
"items": {
"title": "Job",
"description": "Information of a job execution in a workflow run",
"type": "object",
"properties": {
"id": {
"description": "The id of the job.",
"example": 21,
"type": "integer"
},
"run_id": {
"description": "The id of the associated workflow run.",
"example": 5,
"type": "integer"
},
"run_url": {
"type": "string",
"example": "https://api.github.com/repos/github/hello-world/actions/runs/5"
},
"run_attempt": {
"type": "integer",
"description": "Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDg6Q2hlY2tSdW40"
},
"head_sha": {
"description": "The SHA of the commit that is being run.",
"example": "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d",
"type": "string"
},
"url": {
"type": "string",
"example": "https://api.github.com/repos/github/hello-world/actions/jobs/21"
},
"html_url": {
"type": "string",
"example": "https://github.com/github/hello-world/runs/4",
"nullable": true
},
"status": {
"description": "The phase of the lifecycle that the job is currently in.",
"example": "queued",
"type": "string",
"enum": [
"queued",
"in_progress",
"completed",
"waiting",
"requested",
"pending"
]
},
"conclusion": {
"description": "The outcome of the job.",
"example": "success",
"type": "string",
"nullable": true,
"enum": [
"success",
"failure",
"neutral",
"cancelled",
"skipped",
"timed_out",
"action_required"
]
},
"created_at": {
"description": "The time that the job created, in ISO 8601 format.",
"example": "2019-08-08T08:00:00-07:00",
"format": "date-time",
"type": "string"
},
"started_at": {
"description": "The time that the job started, in ISO 8601 format.",
"example": "2019-08-08T08:00:00-07:00",
"format": "date-time",
"type": "string"
},
"completed_at": {
"description": "The time that the job finished, in ISO 8601 format.",
"example": "2019-08-08T08:00:00-07:00",
"format": "date-time",
"type": "string",
"nullable": true
},
"name": {
"description": "The name of the job.",
"example": "test-coverage",
"type": "string"
},
"steps": {
"description": "Steps in this job.",
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"status",
"conclusion",
"number"
],
"properties": {
"status": {
"description": "The phase of the lifecycle that the job is currently in.",
"example": "queued",
"type": "string",
"enum": [
"queued",
"in_progress",
"completed"
]
},
"conclusion": {
"description": "The outcome of the job.",
"example": "success",
"type": "string",
"nullable": true
},
"name": {
"description": "The name of the job.",
"example": "test-coverage",
"type": "string"
},
"number": {
"type": "integer",
"example": 1
},
"started_at": {
"description": "The time that the step started, in ISO 8601 format.",
"example": "2019-08-08T08:00:00-07:00",
"format": "date-time",
"type": "string",
"nullable": true
},
"completed_at": {
"description": "The time that the job finished, in ISO 8601 format.",
"example": "2019-08-08T08:00:00-07:00",
"format": "date-time",
"type": "string",
"nullable": true
}
}
}
},
"check_run_url": {
"type": "string",
"example": "https://api.github.com/repos/github/hello-world/check-runs/4"
},
"labels": {
"type": "array",
"items": {
"type": "string"
},
"description": "Labels for the workflow job. Specified by the \"runs_on\" attribute in the action's workflow file.",
"example": [
"self-hosted",
"foo",
"bar"
]
},
"runner_id": {
"type": "integer",
"nullable": true,
"example": 1,
"description": "The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"
},
"runner_name": {
"type": "string",
"nullable": true,
"example": "my runner",
"description": "The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"
},
"runner_group_id": {
"type": "integer",
"nullable": true,
"example": 2,
"description": "The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"
},
"runner_group_name": {
"type": "string",
"nullable": true,
"example": "my runner group",
"description": "The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.)"
},
"workflow_name": {
"type": "string",
"description": "The name of the workflow.",
"nullable": true,
"example": "Build"
},
"head_branch": {
"type": "string",
"description": "The name of the current branch.",
"nullable": true,
"example": "main"
}
},
"required": [
"id",
"node_id",
"run_id",
"run_url",
"head_sha",
"workflow_name",
"head_branch",
"name",
"url",
"html_url",
"status",
"conclusion",
"started_at",
"completed_at",
"check_run_url",
"labels",
"runner_id",
"runner_name",
"runner_group_id",
"runner_group_name",
"created_at"
]
}
}
}
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('actionsListJobsForWorkflowRunAttempt', {
# Add required parameters here
})