You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
Today we're making a few minor changes to the[Deployments API preview][2]. With the introduction of[combined statuses][4] in a[recent update][3], we noticed a few inconsistencies with the API that we'd like to remedy.
9
+
10
+
We're introducing a new parameter called`required_contexts`. This parameter accepts an array of named[commit status][5] contexts that are ensured to be in a "success" state before the deployment is created. This allows you to verify that more than one system verified your code before you deploy it.
11
+
12
+
We've removed support for the`force` parameter. The force parameter existed to bypass both the auto-merge and commit status checks. The same behavior can now be accomplished by setting`auto_merge` and`required_contexts` appropriately.
13
+
14
+
We're also setting a context for all[commit statuses][5]. If a commit status is created without a context, we'll now set it to the string "default".
15
+
16
+
If you have any questions or concerns,[drop us a line][1].
repository is not required to use commit statuses. If no commit statuses are
104
-
present, the deployment will always be created.)
105
-
106
-
The`force` parameter can be used when you really just need a deployment to go
107
-
out. In these cases, all checks are bypassed, and the deployment is created for
108
-
the ref.
109
100
110
101
The`auto_merge` parameter is used to ensure that the requested ref is not
111
102
behind the repository's default branch. If the ref*is* behind the default
112
103
branch for the repository, we will attempt to merge it for you. If the merge
113
104
succeeds, the API will return a successful merge commit. If merge conflicts
114
105
prevent the merge from succeeding, the API will return a failure response.
115
106
107
+
By default,[commit statuses](/v3/repos/statuses) for every submitted context must be in a 'success' state. The`required_contexts` parameter allows you to specify a subset of contexts that must be "success", or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed.
108
+
116
109
The`payload` parameter is available for any extra information that a
117
110
deployment system might need. It is a JSON text field that will be passed on
118
111
when a deployment event is dispatched.
@@ -126,13 +119,16 @@ Users with push access can create a deployment for a given ref:
126
119
Name | Type | Description
127
120
-----|------|--------------
128
121
`ref`|`string`|**Required**. The ref to deploy. This can be a branch, tag, or sha.
129
-
`force`|`boolean`| Optional parameter to bypass any ahead/behind checks or commit status checks. Default:`false`
122
+
`auto_merge`|`boolean`| Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default:`true`
123
+
`required_contexts`|`Array`| Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts.
130
124
`payload`|`string` | Optional JSON payload with extra information about the deployment. Default:`""`
131
125
`environment`|`string` | Optional name for the target deployment environment (e.g., production, staging, qa). Default:`"production"`
132
-
`auto_merge`|`boolean`| Optional parameter to merge the default branch into the requested deployment branch if necessary. Default:`false`
133
126
`description`|`string` | Optional short description. Default:`""`
134
127
135
-
####Example
128
+
####Simple Example
129
+
130
+
A simple example putting the user and room into the payload to notify back to
Copy file name to clipboardExpand all lines: content/v3/repos/statuses.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Name | Type | Description
38
38
`state`|`string` |**Required**. The state of the status. Can be one of`pending`,`success`,`error`, or`failure`.
39
39
`target_url`|`string` | 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.<br/>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:<br/>`http://ci.example.com/user/repo/build/sha`.
40
40
`description`|`string` | A short description of the status.
41
-
`context`|`string` | A string label to differentiate this status from the status of other systems.
41
+
`context`|`string` | A string label to differentiate this status from the status of other systems. Default:`"default"`