I am using the below snippet to add the repos to an existing team "ADMIN" and then to change the permissions of all the repos to 'Admin'.
from github import **Github**
def teams_permissions(pat):
print("")
admin = 'ADMIN'
for teams in g.get_organization(org_name).get_teams():
for repo in g.get_organization(org_name).get_repos():
if(teams.name != None and admin in teams.name):
value = teams.update_team_repository(repo, 'admin')
teams.add_to_repos(repo)
print(value)
print(teams.get_repo_permission(repo))
Output:
True
Permissions(triage=False, push=False, pull=True, maintain=False, admin=False)
The return of "teams.update_team_repository(repo, 'admin')" is True but then the "teams.get_repo_permission(repo)" returns as pull=True i.e. it still has the Read permission. The same is confirmed from the GUI.
Am I missing something here?