https://github.com/vmware-archive/medusa
A simple CLI wrapper around the GitHub REST API, for working with GitHub organizations. GO + ORG -> GORGON -> MEDUSA
https://github.com/vmware-archive/medusa
Last synced: 5 months ago
JSON representation
A simple CLI wrapper around the GitHub REST API, for working with GitHub organizations. GO + ORG -> GORGON -> MEDUSA
- Host: GitHub
- URL: https://github.com/vmware-archive/medusa
- Owner: vmware-archive
- License: bsd-2-clause
- Archived: true
- Created: 2018-05-16T16:01:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T15:08:41.000Z (about 4 years ago)
- Last Synced: 2024-12-19T00:04:20.631Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# medusa
This project is a WIP!
# Setting up your GitHub API key
1. Log into GitHub.
2. Click on the emoji dropdown in the upper right corner and choose "Settings"
3. Click on the Developer Settings link at the bottom of the left hand nav bar.
4. Click on Personal access tokens.
5. Click on Generate new token.
6. Enter a token description
7. Check repo:status, repo_deployment and public_repo under repo, read:org under admin:org, read:user and user:email under user
8. Copy the API key and store it somewhere safe, you will need to copy it to your clipboard when you run Medusa the first time.
TODO:
list of V2 features
medusa invite
medusa remove
what else???
The goal is to wrap, combine and enhance calls the to the GitHub org REST API:
curl -s -H "Authorization: token API_KEY" https://api.github.com/repos/carbonblack/automation-groovy/collaborators
curl -s -H "Authorization: token API_KEY" https://api.github.com/repos/carbonblack/automation-groovy
for repo in $(curl -s -H "Authorization: token API_KEY" 'https://api.github.com/orgs/carbonblack/repos?type=private&per_page=100' | jq -r '.[].name');do curl -s -H "Authorization: token API_KEY" https://api.github.com/repos/carbonblack/${repo}/collaborators &> ${repo}.txt;done
for repo_file in *.txt;do repo=${repo_file%.txt};echo ${repo};cat ${repo_file} | jq -r '.[] | select(.permissions.admin == true) | .login';echo "";done > repo_admins.out
for repo_file in *.txt;do repo=${repo_file%.txt};echo ${repo};cat ${repo_file} | jq -r '.[] | select(.permissions.admin == true) | .login';echo "";done > repo_admins.out
curl -s -H "Authorization: token API_KEY" 'https://api.github.com/orgs/carbonblack/members?type=private&per_page=100&page=1&role=admin' | jq '.[]'
curl -s -H "Authorization: token API_KEY" 'https://api.github.com/orgs/carbonblack/members?type=private&per_page=100&role=admin' | jq '.[]'
curl -s -H "Authorization: token API_KEY" https://api.github.com/orgs/carbonblack/members