Skip to content

Commit

Permalink
Adding scripts to close #161
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo committed Jul 18, 2024
1 parent fe8d642 commit 25ef697
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
20 changes: 20 additions & 0 deletions get-an-external-group.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#get-an-external-group
# GET /orgs/{org}/external-group/{group_id}


# If the script is passed an argument $1 use that as the name
if [ -z "$1" ]
then
group_id=1
else
group_id=$1
fi


curl ${curl_custom_flags} \
-H "X-GitHub-Api-Version: ${github_api_version}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/orgs/${org}/external-group/${group_id}" --data @${json_file}
21 changes: 21 additions & 0 deletions list-a-connection-between-an-external-group-and-a-team.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
. ./.gh-api-examples.conf

# 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
# GET /orgs/{org}/teams/{team_slug}/external-groups


# If the script is passed an argument $1 use that as the name
if [ -z "$1" ]
then
team_slug=$team_slug
else
team_slug=$1
fi


curl ${curl_custom_flags} \
-H "X-GitHub-Api-Version: ${github_api_version}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/orgs/${org}/teams/${team_slug}/external-groups"

21 changes: 21 additions & 0 deletions list-external-groups-in-an-organization.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/enterprise-cloud@latest/rest/teams/external-groups?apiVersion=2022-11-28#list-external-groups-in-an-organization
# GET /orgs/{org}/external-groups


# If the script is passed an argument $1 use that as the name
if [ -z "$1" ]
then
org=$org
else
org=$1
fi


curl ${curl_custom_flags} \
-H "X-GitHub-Api-Version: ${github_api_version}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/orgs/${org}/external-groups"

0 comments on commit 25ef697

Please sign in to comment.