Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit fbe55cb

Browse files
committed
Implement deployment creation
1 parent b923623 commit fbe55cb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/ci/update_pr_preview.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def add_label(self, pull_request_number, name):
6767
)
6868
request('POST', url, {'labels': [name]})
6969

70+
def create_deployment(self, ref):
71+
url = '{}/repos/{}/{}/deployments'.format(
72+
self._host, self._org, self._repo
73+
)
74+
request('POST', url, {'ref': ref})
75+
7076
class Remote(object):
7177
def __init__(self, url):
7278
self._url = url
@@ -177,6 +183,9 @@ def main(host, organization, repository):
177183
)
178184
remote.update_ref(refspec_labeled, latest_revision)
179185

186+
logger.info('Creating GitHub Deployment')
187+
project.create_deployment(latest_revision)
188+
180189
if revision_open != latest_revision:
181190
logger.info(
182191
'Updating ref "{}" to {}'.format(refspec_open, latest_revision)

0 commit comments

Comments
 (0)