Skip to content

Commit

Permalink
Merge pull request gm3dmo#81 from gm3dmo/mcfluffinstein-patch-1
Browse files Browse the repository at this point in the history
Add script to remove public org membership
  • Loading branch information
gm3dmo committed Jan 24, 2023
2 parents 8636646 + 77c8dbc commit 034e531
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
. .gh-api-examples.conf

# https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#remove-public-organization-membership-for-the-authenticated-user
# DELETE /orgs/{org}/public_members/{username}

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

curl -X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
${GITHUB_API_BASE_URL}/orgs/${org}/public_members/${username}

0 comments on commit 034e531

Please sign in to comment.