forked from gm3dmo/the-power
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gm3dmo#81 from gm3dmo/mcfluffinstein-patch-1
Add script to remove public org membership
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
remove-public-organization-membership-for-the-authenticated-user.sh
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 @@ | ||
. .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} |