Skip to content

Commit

Permalink
Add unarchiving support
Browse files Browse the repository at this point in the history
The github API now allows unarchiving an archived repo. This removes the check so that we ar able to unarchive repos using pygithub.
  • Loading branch information
Tsuesun committed Dec 29, 2022
1 parent 6c53e54 commit 774a32a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -46,5 +46,6 @@
/doc/doctrees/
.vscode*
.venv
venv
.tox/
.mypy_cache/
6 changes: 3 additions & 3 deletions github/Repository.py
Expand Up @@ -1582,7 +1582,7 @@ def edit(
:param allow_merge_commit: bool
:param allow_rebase_merge: bool
:param delete_branch_on_merge: bool
:param archived: bool. Unarchiving repositories is currently not supported through API (https://docs.github.com/en/rest/reference/repos#update-a-repository)
:param archived: bool
:rtype: None
"""
if name is None:
Expand Down Expand Up @@ -1627,8 +1627,8 @@ def edit(
assert delete_branch_on_merge is github.GithubObject.NotSet or isinstance(
delete_branch_on_merge, bool
), delete_branch_on_merge
assert archived is github.GithubObject.NotSet or (
isinstance(archived, bool) and archived is True
assert archived is github.GithubObject.NotSet or isinstance(
archived, bool
), archived
post_parameters = {
"name": name,
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Expand Up @@ -2,3 +2,4 @@ cryptography
httpretty>=1.0.3
pytest>=5.3
pytest-cov>=2.8
pre-commit>=2.21.0

0 comments on commit 774a32a

Please sign in to comment.