GitHub: List commits
GitHub repos.reposListCommits: arguments, response, policy and SDK examples.
← Repos operations · Get started
Operation github.repos_list_commits
Provider route: GET /repos/{owner}/{repo}/commits. 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["repos"]["reposListCommits"]>[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.repos.reposListCommits(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.repos.repos_list_commits(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 | |
query | object | Optional | Additional keys: not allowed |
query.sha | string | Optional | |
query.path | string | Optional | |
query.author | string | Optional | |
query.committer | string | Optional | |
query.since | string | Optional | Format: date-time |
query.until | string | Optional | Format: date-time |
query.per_page | integer | Optional | Default: 30 |
query.page | integer | Optional | Default: 1 |
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 |
|---|---|---|---|
$ | array | Root | |
$[] | Model | Each item | Expand Get a commit — response body |
Referenced models: Get a commit — response body
Schemas
Section titled “Schemas”Get a commit — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Commit |
author | JSON | Required within parent | |
author (anyOf 1) | JSON | Alternative | |
author (anyOf 1) (anyOf 1) | Model | Alternative | Expand List users — response body — item |
author (anyOf 1) (anyOf 2) | Model | Alternative | Expand Re-run a workflow — response body |
author (anyOf 2) | null | Alternative | |
comments_url | string | Required within parent | Format: uri |
commit | object | Required within parent | |
commit.author | Model | Required within parent | Expand Get a commit — response body — commit author |
commit.comment_count | JSON | Required within parent | |
commit.comment_count (anyOf 1) | integer | Alternative | |
commit.comment_count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
commit.committer | Model | Required within parent | Expand Get a commit — response body — commit author |
commit.message | string | Required within parent | |
commit.tree | object | Required within parent | |
commit.tree.sha | string | Required within parent | |
commit.tree.url | string | Required within parent | Format: uri |
commit.url | string | Required within parent | Format: uri |
commit.verification | Model | Optional | Expand Get a tag — response body — verification |
committer | JSON | Required within parent | |
committer (anyOf 1) | JSON | Alternative | |
committer (anyOf 1) (anyOf 1) | Model | Alternative | Expand List users — response body — item |
committer (anyOf 1) (anyOf 2) | Model | Alternative | Expand Re-run a workflow — response body |
committer (anyOf 2) | null | Alternative | |
files | array | Optional | |
files[] | Model | Each item | Expand List pull requests files — response body — item |
html_url | string | Required within parent | Format: uri |
node_id | string | Required within parent | |
parents | array | Required within parent | |
parents[] | object | Each item | |
parents[].html_url | string | Optional | Format: uri |
parents[].sha | string | Required within parent | |
parents[].url | string | Required within parent | Format: uri |
sha | string | Required within parent | |
stats | object | Optional | |
stats.additions | JSON | Optional | |
stats.additions (anyOf 1) | integer | Alternative | |
stats.additions (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
stats.deletions | JSON | Optional | |
stats.deletions (anyOf 1) | integer | Alternative | |
stats.deletions (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
stats.total | JSON | Optional | |
stats.total (anyOf 1) | integer | Alternative | |
stats.total (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
url | string | Required within parent | Format: uri |
Referenced models: List pull requests files — response body — item, Re-run a workflow — response body, Get a commit — response body — commit author, List users — response body — item, Get a tag — response body — verification
List pull requests files — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Diff Entry |
additions | JSON | Required within parent | |
additions (anyOf 1) | integer | Alternative | |
additions (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
blob_url | string | Required within parent | Format: uri |
changes | JSON | Required within parent | |
changes (anyOf 1) | integer | Alternative | |
changes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
contents_url | string | Required within parent | Format: uri |
deletions | JSON | Required within parent | |
deletions (anyOf 1) | integer | Alternative | |
deletions (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
filename | string | Required within parent | |
patch | string | Optional | |
previous_filename | string | Optional | |
raw_url | string | Required within parent | Format: uri |
sha | JSON | Required within parent | |
sha (anyOf 1) | string | Alternative | |
sha (anyOf 2) | null | Alternative | |
status | string | Required within parent | Known values: added, removed, modified, renamed, copied, changed, unchanged |
Re-run a workflow — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An object without any properties. Additional keys: not allowed |
Get a commit — response body — commit author
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | Metaproperties for Git author/committer information. |
$ (anyOf 1).date | string | Optional | Format: date-time |
$ (anyOf 1).email | string | Optional | |
$ (anyOf 1).name | string | Optional | |
$ (anyOf 2) | null | Alternative |
List users — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A GitHub user. |
avatar_url | string | Required within parent | Format: uri |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | |
email (anyOf 2) | null | Alternative | |
events_url | string | Required within parent | |
followers_url | string | Required within parent | Format: uri |
following_url | string | Required within parent | |
gists_url | string | Required within parent | |
gravatar_id | JSON | Required within parent | |
gravatar_id (anyOf 1) | string | Alternative | |
gravatar_id (anyOf 2) | null | Alternative | |
html_url | string | Required within parent | Format: uri |
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]+)?$ |
login | string | Required within parent | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | |
name (anyOf 2) | null | Alternative | |
node_id | string | Required within parent | |
organizations_url | string | Required within parent | Format: uri |
received_events_url | string | Required within parent | Format: uri |
repos_url | string | Required within parent | Format: uri |
site_admin | boolean | Required within parent | |
starred_at | string | Optional | |
starred_url | string | Required within parent | |
subscriptions_url | string | Required within parent | Format: uri |
type | string | Required within parent | |
url | string | Required within parent | Format: uri |
user_view_type | string | Optional |
Get a tag — response body — verification
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
payload | JSON | Required within parent | |
payload (anyOf 1) | string | Alternative | |
payload (anyOf 2) | null | Alternative | |
reason | string | Required within parent | |
signature | JSON | Required within parent | |
signature (anyOf 1) | string | Alternative | |
signature (anyOf 2) | null | Alternative | |
verified | boolean | Required within parent | |
verified_at | JSON | Required within parent | |
verified_at (anyOf 1) | string | Alternative | |
verified_at (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.repos_list_commits. Catalog operation: repos/list-commits. 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"}