status_commits
Creates, updates, deletes, gets or lists a status_commits resource.
Overview
| Name | status_commits |
| Type | Resource |
| Id | github.repos.status_commits |
Fields
The following fields are returned by SELECT queries:
- list_commit_statuses_for_ref
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | |
avatar_url | string | |
context | string | |
created_at | string | |
creator | object | A GitHub user. (title: Simple User) |
description | string | |
state | string | |
target_url | string | |
updated_at | string | |
url | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_commit_statuses_for_ref | select | owner, repo, ref | per_page, page | Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref. |
create_commit_status | insert | owner, repo, sha, state | Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per sha and context within a repository. Attempts to create more than 1000 statuses will result in a validation error. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
ref | string | The commit reference. Can be a commit SHA, branch name (heads/BRANCH_NAME), or tag name (tags/TAG_NAME). For more information, see "Git References" in the Git documentation. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
sha | string | |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_commit_statuses_for_ref
Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.
This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref.
SELECT
id,
node_id,
avatar_url,
context,
created_at,
creator,
description,
state,
target_url,
updated_at,
url
FROM github.repos.status_commits
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_commit_status
- Manifest
Users with push access in a repository can create commit statuses for a given SHA.
Note: there is a limit of 1000 statuses per sha and context within a repository. Attempts to create more than 1000 statuses will result in a validation error.
INSERT INTO github.repos.status_commits (
state,
target_url,
description,
context,
owner,
repo,
sha
)
SELECT
'{{ state }}' /* required */,
'{{ target_url }}',
'{{ description }}',
'{{ context }}',
'{{ owner }}',
'{{ repo }}',
'{{ sha }}'
RETURNING
id,
node_id,
avatar_url,
context,
created_at,
creator,
description,
state,
target_url,
updated_at,
url
;
# Description fields are for documentation purposes
- name: status_commits
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the status_commits resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the status_commits resource.
- name: sha
value: "{{ sha }}"
description: Required parameter for the status_commits resource.
- name: state
value: "{{ state }}"
description: |
The state of the status.
valid_values: ['error', 'failure', 'pending', 'success']
- name: target_url
value: "{{ target_url }}"
description: |
The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status.
For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA:
`http://ci.example.com/user/repo/build/sha`
- name: description
value: "{{ description }}"
description: |
A short description of the status.
- name: context
value: "{{ context }}"
description: |
A string label to differentiate this status from the status of other systems. This field is case-insensitive.
default: default