GitHub: Get a workflow run attempt
GitHub actions.actionsGetWorkflowRunAttempt: arguments, response, policy and SDK examples.
← Actions operations · Get started
Operation github.actions_get_workflow_run_attempt
Provider route: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["actions"]["actionsGetWorkflowRunAttempt"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.actions.actionsGetWorkflowRunAttempt(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_github import GitHubIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.actions.actions_get_workflow_run_attempt(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.owner | string | Required within parent | |
path.repo | string | Required within parent | |
path.run_id | integer | Required within parent | |
path.attempt_number | integer | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.exclude_pull_requests | boolean | Optional | Default: false |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get a workflow run — response body |
Referenced models: Get a workflow run — response body
Schemas
Section titled “Schemas”4 more schemas are linked from the tables above, on the schema pages.
Get a workflow run — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An invocation of a workflow |
actor | Model | Optional | Expand List users — response body — item |
artifacts_url | string | Required within parent | The URL to the artifacts for the workflow run. |
cancel_url | string | Required within parent | The URL to cancel the workflow run. |
check_suite_id | JSON | Optional | |
check_suite_id (anyOf 1) | integer | Alternative | The ID of the associated check suite. Format: int64 |
check_suite_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
check_suite_node_id | string | Optional | The node ID of the associated check suite. |
check_suite_url | string | Required within parent | The URL to the associated check suite. |
conclusion | JSON | Required within parent | |
conclusion (anyOf 1) | string | Alternative | |
conclusion (anyOf 2) | null | Alternative | |
created_at | string | Required within parent | Format: date-time |
display_title | string | Required within parent | The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. |
event | string | Required within parent | |
head_branch | JSON | Required within parent | |
head_branch (anyOf 1) | string | Alternative | |
head_branch (anyOf 2) | null | Alternative | |
head_commit | Model | Required within parent | Expand Get a workflow run — response body — head commit |
head_repository | Model | Required within parent | Expand Transfer a repository — response body |
head_repository_id | JSON | Optional | |
head_repository_id (anyOf 1) | integer | Alternative | |
head_repository_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
head_sha | string | Required within parent | The SHA of the head commit that points to the version of the workflow being run. |
html_url | string | Required within parent | |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | The ID of the workflow run. Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
jobs_url | string | Required within parent | The URL to the jobs for the workflow run. |
logs_url | string | Required within parent | The URL to download the logs for the workflow run. |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name of the workflow run. |
name (anyOf 2) | null | Alternative | |
node_id | string | Required within parent | |
path | string | Required within parent | The full path of the workflow |
previous_attempt_url | JSON | Optional | |
previous_attempt_url (anyOf 1) | string | Alternative | The URL to the previous attempted run of this workflow, if one exists. |
previous_attempt_url (anyOf 2) | null | Alternative | |
pull_requests | JSON | Required within parent | |
pull_requests (anyOf 1) | array | Alternative | Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. |
pull_requests (anyOf 1)[] | Model | Each item | Expand Get a check run — response body — pull requests item |
pull_requests (anyOf 2) | null | Alternative | |
referenced_workflows | JSON | Optional | |
referenced_workflows (anyOf 1) | array | Alternative | |
referenced_workflows (anyOf 1)[] | Model | Each item | Expand Get a workflow run — response body — referenced workflows array item |
referenced_workflows (anyOf 2) | null | Alternative | |
repository | Model | Required within parent | Expand Transfer a repository — response body |
rerun_url | string | Required within parent | The URL to rerun the workflow run. |
run_attempt | JSON | Optional | |
run_attempt (anyOf 1) | integer | Alternative | Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. |
run_attempt (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
run_number | JSON | Required within parent | |
run_number (anyOf 1) | integer | Alternative | The auto incrementing run number for the workflow run. |
run_number (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
run_started_at | string | Optional | The start time of the latest run. Resets on re-run. Format: date-time |
status | JSON | Required within parent | |
status (anyOf 1) | string | Alternative | |
status (anyOf 2) | null | Alternative | |
triggering_actor | Model | Optional | Expand List users — response body — item |
updated_at | string | Required within parent | Format: date-time |
url | string | Required within parent | The URL to the workflow run. |
workflow_id | JSON | Required within parent | |
workflow_id (anyOf 1) | integer | Alternative | The ID of the parent workflow. |
workflow_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
workflow_url | string | Required within parent | The URL to the workflow. |
Referenced models: Transfer a repository — response body, Get a workflow run — response body — head commit, Get a check run — response body — pull requests item, Get a workflow run — response body — referenced workflows array item, List users — response body — item
Get a workflow run — response body — head commit
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Get a workflow run — response body — head commit A commit |
$ (anyOf 2) | null | Alternative |
Referenced models: Get a workflow run — response body — head commit A commit
Get a check run — response body — pull requests item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
base | object | Required within parent | |
base.ref | string | Required within parent | |
base.repo | object | Required within parent | |
base.repo.id | JSON | Required within parent | |
base.repo.id (anyOf 1) | integer | Alternative | Format: int64 |
base.repo.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
base.repo.name | string | Required within parent | |
base.repo.url | string | Required within parent | |
base.sha | string | Required within parent | |
head | object | Required within parent | |
head.ref | string | Required within parent | |
head.repo | object | Required within parent | |
head.repo.id | JSON | Required within parent | |
head.repo.id (anyOf 1) | integer | Alternative | Format: int64 |
head.repo.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
head.repo.name | string | Required within parent | |
head.repo.url | string | Required within parent | |
head.sha | string | Required within parent | |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
number | JSON | Required within parent | |
number (anyOf 1) | integer | Alternative | |
number (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
url | string | Required within parent |
Get a workflow run — response body — referenced workflows array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A workflow referenced/reused by the initial caller workflow |
path | string | Required within parent | |
ref | string | Optional | |
sha | string | Required within parent |
Get a code of conduct — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Code Of Conduct |
body | string | Optional | |
html_url | JSON | Required within parent | |
html_url (anyOf 1) | string | Alternative | Format: uri |
html_url (anyOf 2) | null | Alternative | |
key | string | Required within parent | |
name | string | Required within parent | |
url | string | Required within parent | Format: uri |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.actions_get_workflow_run_attempt. Catalog operation: actions/get-workflow-run-attempt. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}