Skip to content

Commit

Permalink
Merge pull request #1074 from greggilbert/feature/add-deployment-stat…
Browse files Browse the repository at this point in the history
…uses

Allow more deployment statuses per Github docs
  • Loading branch information
sigmavirus24 committed Feb 15, 2022
2 parents 1d27cfe + 40b9f2e commit 6db9296
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.rst
Expand Up @@ -210,3 +210,5 @@ Contributors
- Thomas Lam (@lamcw)

- David Glick (@davisagli)

- Greg Gilbert (@greggilbert)
16 changes: 16 additions & 0 deletions docs/source/release-notes/3.2.0.rst
@@ -0,0 +1,16 @@
3.2.0: 2022-xx-xx
-----------------

Dependency Change
`````````````````


Features Added
``````````````

- Added more allowed statuses to Deployments for
:meth:`github3.repos.deployment.Deployment.create_status()`


Bug Fixes
`````````
1 change: 1 addition & 0 deletions docs/source/release-notes/index.rst
Expand Up @@ -9,6 +9,7 @@ here with the newest releases first.
==================

.. toctree::
3.2.0
3.1.0
3.0.0

Expand Down
13 changes: 11 additions & 2 deletions src/github3/repos/deployment.py
Expand Up @@ -77,7 +77,8 @@ def create_status(self, state, target_url=None, description=None):
:param str state:
(required), The state of the status. Can be one of
``pending``, ``success``, ``error``, or ``failure``.
``pending``, ``success``, ``error``, ``inactive``,
``in_progress``, ``queued``, or ``failure``.
:param str target_url:
The target URL to associate with this status.
This URL should contain output to keep the user updated while the
Expand All @@ -92,7 +93,15 @@ def create_status(self, state, target_url=None, description=None):
"""
json = None

if state in ("pending", "success", "error", "failure"):
if state in (
"pending",
"success",
"error",
"inactive",
"in_progress",
"queued",
"failure",
):
data = {
"state": state,
"target_url": target_url,
Expand Down

0 comments on commit 6db9296

Please sign in to comment.