8000 Add delete_branch_on_merge to orgs and main interface · pythonthings/github3.py@80009e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 80009e4

Browse files
committed
Add delete_branch_on_merge to orgs and main interface
1 parent f4a308d commit 80009e4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/github3/github.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ def create_repository(
788788
auto_init=False,
789789
gitignore_template="",
790790
has_projects=True,
791+
delete_branch_on_merge=False,
791792
):
792793
"""Create a repository for the authenticated user.
793794
@@ -816,6 +817,9 @@ def create_repository(
816817
:param bool has_projects:
817818
(optional), If ``True``, enable projects for this repository. API
818819
default: ``True``
820+
:param bool delete_branch_on_merge:
821+
(optional) If ``True``, head branches will automatically be deleted
822+
when pull requests are merged. API default: ``False``
819823
:returns:
820824
created repository
821825
:rtype:
@@ -832,6 +836,7 @@ def create_repository(
832836
"auto_init": auto_init,
833837
"gitignore_template": gitignore_template,
834838
"has_projects": has_projects,
839+
"delete_branch_on_merge": delete_branch_on_merge,
835840
}
836841
json = self._json(self._post(url, data=data), 201)
837842
return self._instance_or_null(repo.Repository, json)

src/github3/orgs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ def create_repository(
623623
gitignore_template="",
624624
license_template="",
625625
has_projects=True,
626+
delete_branch_on_merge=False,
626627
):
627628
"""Create a repository for this organization.
628629
@@ -662,6 +663,9 @@ def create_repository(
662663
:param bool has_projects:
663664
(optional), If ``True``, enable projects for this repository. API
664665
default: ``True``
666+
:param bool delete_branch_on_merge:
667+
(optional) If ``True``, head branches will automatically be deleted
668+
when pull requests are merged. API default: ``False``
665669
:returns:
666670
the created repository
667671
:rtype:
@@ -679,6 +683,7 @@ def create_repository(
679683
"auto_init": auto_init,
680684
"gitignore_template": gitignore_template,
681685
"has_projects": has_projects,
686+
"delete_branch_on_merge": delete_branch_on_merge,
682687
}
683688
if int(team_id) > 0:
684689
data.update({"team_id": team_id})

0 commit comments

Comments
 (0)
0