Skip to content

Commit

Permalink
add include_all_branches for create_repo_from_template in Organiz…
Browse files Browse the repository at this point in the history
…ation and AuthenticatedUser
  • Loading branch information
janssonoskar committed Jan 12, 2024
1 parent 603896f commit a3e32a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions github/AuthenticatedUser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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,
}
)
Expand Down
10 changes: 9 additions & 1 deletion github/Organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tests/AuthenticatedUser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a3e32a0

Please sign in to comment.