deployment_id parameter
Get a deployment
Path Parameters
Response
application/json
Response
Response
Deployment
A request for a specific ref(branch,sha,tag) to be deployed
Example:https://api.github.com/repos/octocat/example/deployments/1
Unique identifier of the deployment
Example:42
Example:MDEwOkRlcGxveW1lbnQx
Example:a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d
The ref to deploy. This can be a branch, tag, or sha.
Example:topic-branch
Parameter to specify a task to execute
Example:deploy
One Of
Example:staging
Name for the target deployment environment.
Example:production
Example:Deploy request from hubot
Simple User
Show Child Parameters
Example:2012-07-20T01:19:13Z
Example:2012-07-20T01:19:13Z
Example:https://api.github.com/repos/octocat/example/deployments/1/statuses
Example:https://api.github.com/repos/octocat/example
Specifies if the given environment is will no longer exist at some point in the future. Default: false.
Example:true
Specifies if the given environment is one that end-users directly interact with. Default: false.
Example:true
GitHub 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.
Show Child Parameters
Path Parameters
Delete a deployment
If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo
or repo_deployment
scopes can delete a deployment.
To set a deployment as inactive, you must:
- Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
- Mark the active deployment as inactive by adding any non-successful deployment status.
For more information, see “Create a deployment” and “Create a deployment status.”
Path Parameters
deployment_id parameter
Response
Response
Response
Path Parameters
List deployment statuses
Users with pull access can view deployment statuses for a deployment:
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
deployment_id parameter
Response
application/json
Response
Response
The status of a deployment.
Example:https://api.github.com/repos/octocat/example/deployments/42/statuses/1
Example:1
Example:MDE2OkRlcGxveW1lbnRTdGF0dXMx
The state of the status.
Allowed values:errorfailureinactivependingsuccessqueuedin_progress
Example:success
Simple User
Show Child Parameters
A short description of the status.
Default:
<= 140 characters
Example:Deployment finished successfully.
The environment of the deployment that the status is for.
Default:
Example:production
Deprecated: the URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
Example:2012-07-20T01:19:13Z
Example:2012-07-20T01:19:13Z
Example:https://api.github.com/repos/octocat/example/deployments/42
Example:https://api.github.com/repos/octocat/example
The URL for accessing your environment.
Default:
Example:https://staging.example.com/
The URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
GitHub 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.
Show Child Parameters
Path Parameters
Query Parameters
Create a deployment status
Users with push
access can create deployment statuses for a given deployment.
GitHub Apps require read & write
access to “Deployments” and read-only
access to “Repo contents” (for private repos). OAuth Apps require the repo_deployment
scope.
Path Parameters
deployment_id parameter
Body
application/json
Body
The state of the status. Can be one of error
, failure
, inactive
, in_progress
, queued
, pending
, or success
. Note: To use the inactive
state, you must provide the application/vnd.github.ant-man-preview+json
custom media type. When you set a transient deployment to inactive
, the deployment will be shown as destroyed
in GitHub.
Allowed values:errorfailureinactivein_progressqueuedpendingsuccess
The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Note: It’s recommended to use the log_url
parameter, which replaces target_url
.
Default:
The full URL of the deployment’s output. This parameter replaces target_url
. We will continue to accept target_url
to support legacy uses, but we recommend replacing target_url
with log_url
. Setting log_url
will automatically set target_url
to the same value. Default: ""
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json
custom media type.
Default:
A short description of the status. The maximum description length is 140 characters.
Default:
Name for the target deployment environment, which can be changed when setting a deploy status. For example, production
, staging
, or qa
.
Allowed values:productionstagingqa
Sets the URL for accessing your environment. Default: ""
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json
custom media type.
Default:
Adds a new inactive
status to all prior non-transient, non-production environment deployments with the same repository and environment
name as the created status’s deployment. An inactive
status is only added to deployments that had a success
state. Default: true
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json
custom media type.
Response
application/json
Response
Response
Deployment Status
The status of a deployment.
Example:https://api.github.com/repos/octocat/example/deployments/42/statuses/1
Example:1
Example:MDE2OkRlcGxveW1lbnRTdGF0dXMx
The state of the status.
Allowed values:errorfailureinactivependingsuccessqueuedin_progress
Example:success
Simple User
Show Child Parameters
A short description of the status.
Default:
<= 140 characters
Example:Deployment finished successfully.
The environment of the deployment that the status is for.
Default:
Example:production
Deprecated: the URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
Example:2012-07-20T01:19:13Z
Example:2012-07-20T01:19:13Z
Example:https://api.github.com/repos/octocat/example/deployments/42
Example:https://api.github.com/repos/octocat/example
The URL for accessing your environment.
Default:
Example:https://staging.example.com/
The URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
GitHub 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.
Show Child Parameters
Path Parameters
Body
Get a deployment status
Users with pull access can view a deployment status for a deployment:
Path Parameters
deployment_id parameter
Response
application/json
Response
Response
Deployment Status
The status of a deployment.
Example:https://api.github.com/repos/octocat/example/deployments/42/statuses/1
Example:1
Example:MDE2OkRlcGxveW1lbnRTdGF0dXMx
The state of the status.
Allowed values:errorfailureinactivependingsuccessqueuedin_progress
Example:success
Simple User
Show Child Parameters
A short description of the status.
Default:
<= 140 characters
Example:Deployment finished successfully.
The environment of the deployment that the status is for.
Default:
Example:production
Deprecated: the URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
Example:2012-07-20T01:19:13Z
Example:2012-07-20T01:19:13Z
Example:https://api.github.com/repos/octocat/example/deployments/42
Example:https://api.github.com/repos/octocat/example
The URL for accessing your environment.
Default:
Example:https://staging.example.com/
The URL to associate with this status.
Default:
Example:https://example.com/deployment/42/output
GitHub 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.