Skip to content

Commit 6db9296

Browse files
authored
Merge pull request #1074 from greggilbert/feature/add-deployment-statuses
Allow more deployment statuses per Github docs
2 parents 1d27cfe + 40b9f2e commit 6db9296

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,5 @@ Contributors
210210
- Thomas Lam (@lamcw)
211211

212212
- David Glick (@davisagli)
213+
214+
- Greg Gilbert (@greggilbert)

docs/source/release-notes/3.2.0.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
3.2.0: 2022-xx-xx
2+
-----------------
3+
4+
Dependency Change
5+
`````````````````
6+
7+
8+
Features Added
9+
``````````````
10+
11+
- Added more allowed statuses to Deployments for
12+
:meth:`github3.repos.deployment.Deployment.create_status()`
13+
14+
15+
Bug Fixes
16+
`````````

docs/source/release-notes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ here with the newest releases first.
99
==================
1010

1111
.. toctree::
12+
3.2.0
1213
3.1.0
1314
3.0.0
1415

src/github3/repos/deployment.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def create_status(self, state, target_url=None, description=None):
7777
7878
:param str state:
7979
(required), The state of the status. Can be one of
80-
``pending``, ``success``, ``error``, or ``failure``.
80+
``pending``, ``success``, ``error``, ``inactive``,
81+
``in_progress``, ``queued``, or ``failure``.
8182
:param str target_url:
8283
The target URL to associate with this status.
8384
This URL should contain output to keep the user updated while the
@@ -92,7 +93,15 @@ def create_status(self, state, target_url=None, description=None):
9293
"""
9394
json = None
9495

95-
if state in ("pending", "success", "error", "failure"):
96+
if state in (
97+
"pending",
98+
"success",
99+
"error",
100+
"inactive",
101+
"in_progress",
102+
"queued",
103+
"failure",
104+
):
96105
data = {
97106
"state": state,
98107
"target_url": target_url,

0 commit comments

Comments
 (0)