-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD automatic adding of ta to github org team
- Loading branch information
Showing
3 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from anubis.github.api import github_rest | ||
|
||
|
||
def list_members(org: str, team: str) -> list[str]: | ||
return [ | ||
user['login'] | ||
for user in github_rest(f"/orgs/{org}/teams/{team}/members") | ||
if 'login' in user | ||
] | ||
|
||
|
||
def add_member(org: str, team: str, username: str): | ||
github_rest(f"/orgs/{org}/teams/{team}/memberships/{username}", method="put") | ||
|
||
|
||
def remove_member(org: str, team: str, username: str): | ||
github_rest(f"/orgs/{org}/teams/{team}/memberships/{username}", method="delete") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters