Skip to content

Commit 25ef697

Browse files
committed
Adding scripts to close #161
1 parent fe8d642 commit 25ef697

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

get-an-external-group.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#get-an-external-group
4+
# GET /orgs/{org}/external-group/{group_id}
5+
6+
7+
# If the script is passed an argument $1 use that as the name
8+
if [ -z "$1" ]
9+
then
10+
group_id=1
11+
else
12+
group_id=$1
13+
fi
14+
15+
16+
curl ${curl_custom_flags} \
17+
-H "X-GitHub-Api-Version: ${github_api_version}" \
18+
-H "Accept: application/vnd.github.v3+json" \
19+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
20+
"${GITHUB_API_BASE_URL}/orgs/${org}/external-group/${group_id}" --data @${json_file}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-a-connection-between-an-external-group-and-a-team
4+
# GET /orgs/{org}/teams/{team_slug}/external-groups
5+
6+
7+
# If the script is passed an argument $1 use that as the name
8+
if [ -z "$1" ]
9+
then
10+
team_slug=$team_slug
11+
else
12+
team_slug=$1
13+
fi
14+
15+
16+
curl ${curl_custom_flags} \
17+
-H "X-GitHub-Api-Version: ${github_api_version}" \
18+
-H "Accept: application/vnd.github.v3+json" \
19+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
20+
"${GITHUB_API_BASE_URL}/orgs/${org}/teams/${team_slug}/external-groups"
21+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-external-groups-in-an-organization
4+
# GET /orgs/{org}/external-groups
5+
6+
7+
# If the script is passed an argument $1 use that as the name
8+
if [ -z "$1" ]
9+
then
10+
org=$org
11+
else
12+
org=$1
13+
fi
14+
15+
16+
curl ${curl_custom_flags} \
17+
-H "X-GitHub-Api-Version: ${github_api_version}" \
18+
-H "Accept: application/vnd.github.v3+json" \
19+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
20+
"${GITHUB_API_BASE_URL}/orgs/${org}/external-groups"
21+

0 commit comments

Comments
 (0)