diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index fb6cd6a888..af01ef8f34 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -468,6 +468,7 @@ def create_repo_from_template( name: str, repo: Repository, description: Opt[str] = NotSet, + include_all_branches: Opt[bool] = NotSet, private: Opt[bool] = NotSet, ) -> Repository: """ @@ -476,12 +477,14 @@ def create_repo_from_template( assert isinstance(name, str), name assert isinstance(repo, github.Repository.Repository), repo assert is_optional(description, str), description + assert is_optional(include_all_branches, bool), include_all_branches assert is_optional(private, bool), private post_parameters: dict[str, Any] = NotSet.remove_unset_items( { "name": name, "owner": self.login, "description": description, + "include_all_branches": include_all_branches, "private": private, } ) diff --git a/github/Organization.py b/github/Organization.py index 5f04613e70..27cad39f81 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -389,6 +389,7 @@ def create_repo_from_template( name: str, repo: Repository, description: Opt[str] = NotSet, + include_all_branches: Opt[bool] = NotSet, private: Opt[bool] = NotSet, ) -> Repository: """self.name @@ -397,9 +398,16 @@ def create_repo_from_template( assert isinstance(name, str), name assert isinstance(repo, github.Repository.Repository), repo assert is_optional(description, str), description + assert is_optional(include_all_branches, bool), include_all_branches assert is_optional(private, bool), private post_parameters: dict[str, Any] = NotSet.remove_unset_items( - {"name": name, "owner": self.login, "description": description, "private": private} + { + "name": name, + "owner": self.login, + "description": description, + "include_all_branches": include_all_branches, + "private": private, + } ) headers, data = self._requester.requestJsonAndCheck( diff --git a/tests/AuthenticatedUser.py b/tests/AuthenticatedUser.py index a9c211c237..432dade35e 100644 --- a/tests/AuthenticatedUser.py +++ b/tests/AuthenticatedUser.py @@ -693,6 +693,7 @@ def testCreateRepoFromTemplateWithAllArguments(self): "hello-world-docker-action-new", template_repo, description=description, + include_all_branches=True, private=private, ) self.assertEqual(repo.description, description)