mirror of
https://github.com/clearlinux/ok.sh.git
synced 2026-09-06 05:31:59 +00:00
Added function to retrieve organization teams
This commit is contained in:
+23
@@ -441,6 +441,29 @@ org_repos() {
|
||||
| _filter ".[] | \"${filter}\""
|
||||
}
|
||||
|
||||
org_teams() {
|
||||
# List teams
|
||||
#
|
||||
# Usage:
|
||||
# org_teams org
|
||||
#
|
||||
# Positional arguments
|
||||
#
|
||||
local org=$1
|
||||
# Organization GitHub login or id.
|
||||
#
|
||||
# Keyword arguments
|
||||
#
|
||||
local filter='\(.name)\t\(.id)\t\(.permission)'
|
||||
# A jq filter using string-interpolation syntax that is applied to each
|
||||
# team in the return data.
|
||||
|
||||
[ -n "$org" ] && shift || _err 'Org name required.' E_INVALID_ARGS
|
||||
|
||||
request "/orgs/${org}/teams" \
|
||||
| _filter ".[] | \"${filter}\""
|
||||
}
|
||||
|
||||
create_repo() {
|
||||
# Create a repository for a user or organization
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user