Skip to main content

status_deployments

Creates, updates, deletes, gets or lists a status_deployments resource.

Overview

Namestatus_deployments
TypeResource
Idgithub.repos.status_deployments

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
node_idstring (example: MDE2OkRlcGxveW1lbnRTdGF0dXMx)
created_atstring (date-time) (example: 2012-07-20T01:19:13Z)
creatorobjectA GitHub user. (title: Simple User)
deployment_urlstring (uri) (example: https://api.github.com/repos/octocat/example/deployments/42)
descriptionstringA short description of the status. (default: , example: Deployment finished successfully.)
environmentstringThe environment of the deployment that the status is for. (default: , example: production)
environment_urlstring (uri)The URL for accessing your environment. (default: , example: https://staging.example.com/)
log_urlstring (uri)The URL to associate with this status. (default: , example: https://example.com/deployment/42/output)
performed_via_github_appobjectGitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. (title: GitHub app)
repository_urlstring (uri) (example: https://api.github.com/repos/octocat/example)
statestringThe state of the status. (error, failure, inactive, pending, success, queued, in_progress) (example: success)
target_urlstring (uri)Closing down notice: the URL to associate with this status. (default: , example: https://example.com/deployment/42/output)
updated_atstring (date-time) (example: 2012-07-20T01:19:13Z)
urlstring (uri) (example: https://api.github.com/repos/octocat/example/deployments/42/statuses/1)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_deployment_statusselectowner, repo, deployment_id, status_idUsers with pull access can view a deployment status for a deployment:
list_deployment_statusesselectowner, repo, deployment_idper_page, pageUsers with pull access can view deployment statuses for a deployment:
create_deployment_statusinsertowner, repo, deployment_id, stateUsers with push access can create deployment statuses for a given deployment.

OAuth app tokens and personal access tokens (classic) need the repo_deployment scope to use this endpoint.

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.

NameDatatypeDescription
deployment_idintegerdeployment_id parameter
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
status_idinteger
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Users with pull access can view a deployment status for a deployment:

SELECT
id,
node_id,
created_at,
creator,
deployment_url,
description,
environment,
environment_url,
log_url,
performed_via_github_app,
repository_url,
state,
target_url,
updated_at,
url
FROM github.repos.status_deployments
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND deployment_id = '{{ deployment_id }}' -- required
AND status_id = '{{ status_id }}' -- required
;

INSERT examples

Users with push access can create deployment statuses for a given deployment.

OAuth app tokens and personal access tokens (classic) need the repo_deployment scope to use this endpoint.

INSERT INTO github.repos.status_deployments (
state,
target_url,
log_url,
description,
environment,
environment_url,
auto_inactive,
owner,
repo,
deployment_id
)
SELECT
'{{ state }}' /* required */,
'{{ target_url }}',
'{{ log_url }}',
'{{ description }}',
'{{ environment }}',
'{{ environment_url }}',
{{ auto_inactive }},
'{{ owner }}',
'{{ repo }}',
'{{ deployment_id }}'
RETURNING
id,
node_id,
created_at,
creator,
deployment_url,
description,
environment,
environment_url,
log_url,
performed_via_github_app,
repository_url,
state,
target_url,
updated_at,
url
;