From ed3409b3aa448293e91b43ccb6cc0800447a0099 Mon Sep 17 00:00:00 2001 From: tsuesun Date: Thu, 29 Dec 2022 14:40:59 +0900 Subject: [PATCH] Add unarchiving support The github API now allows unarchiving an archived repo. This removes the check so that we ar able to unarchive repos using pygithub. --- .gitignore | 1 + github/Repository.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4ed40f015a..ecf955bd15 100644 --- a/.gitignore +++ b/.gitignore @@ -46,5 +46,6 @@ /doc/doctrees/ .vscode* .venv +venv .tox/ .mypy_cache/ diff --git a/github/Repository.py b/github/Repository.py index 2575100675..e55b26dc33 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -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: @@ -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,