-
Notifications
You must be signed in to change notification settings - Fork 7
3. Play with GitHub REST API (using Octokit)
-
Ruby Gem:
octokit 6.1.1
-
Ruby Gem:
git 1.18.0
-
Ruby 2.7.1
-
Create a GitHub personal token and define it in the configuration.rb file for the
GITHUB_PERSONAL_ACCESS_TOKEN
variable. -
Define the GitHub organization name in the configuration.rb file for the
GITHUB_ORGANIZATION_NAME
variable. It will allow to send requests to query and modify your organization. -
Define also the logins of the GitHub adminsitrators of your organization so as to prevent to change their permisssion for example.
gem install octokit
gem install git
of if you have Bundler:
bundle install
This project uses Octokit Ruby client, licensed under MIT license. It also uses Git Ruby gem, under MIT license.
bash GitHubWizard.sh
Keywords: #organisation #GitHub #members
Run the following command and check the file with the FILENAME_MEMBERS name (configuration.rb)
bash GitHubWizard.sh get-all-members
Keywords: #organisation #GitHub #members #2FA #security
Run the following command and check the file with the FILENAME_MEMBERS_2FA_DISABLED name (configuration.rb)
bash GitHubWizard.sh get-members-2fa-disabled
Keywords: #organisation #GitHub #members #company
Run the following command and check the file with the FILENAME_MEMBERS_UNDEFINED_COMPANY name (configuration.rb)
bash GitHubWizard.sh get-members-without-company
Keywords: #organisation #GitHub #members #teams
Run the following command and check the file with the FILENAME_PROJECTS_WITHOUT_TEAM name (configuration.rb)
bash GitHubWizard.sh get-projects-without-team
Keywords: #organisation #GitHub #members #email
Run the following command and check the file with the FILENAME_USERS_WITH_BAD_EMAILS name (configuration.rb)
bash GitHubWizard.sh get-users-with-bad-email
Keywords: #organisation #GitHub #members #fullname #name #handle
Run the following command and check the file with the FILENAME_USERS_WITH_BAD_FULLNAMES name (configuration.rb)
bash GitHubWizard.sh get-users-with-bad-fullname
Keywords: #organisation #GitHub #projects #licenses
Run the following command and check the file with the FILENAME_PROJECTS_WITHOUT_LICENSES (configuration.rb)
bash GitHubWizard.sh get-projects-without-licenses
Keywords: #organisation #GitHub #projects #guidelines #files
Run the following command and check the file with the FILENAME_PROJECTS_WITH_UNCONFORM_REPOSITORIES name (configuration.rb)
bash GitHubWizard.sh get-projects-conformity
SSH will be used to clone repositories, thus you must have your SSH configuration ready:
- Create an SSH key on your GitHub account settings
- Add the SSH key in your environment
ssh-add .ssh/id_rsa
Keywords: #organisation #GitHub #projects #repository
Run the following command and check the file with the FILENAME_EMPTY_PROJECTS name (configuration.rb)
bash GitHubWizard.sh get-empty-projects
SSH will be used to clone repositories, thus you must have your SSH configuration ready:
- Create an SSH key on your GitHub account settings
- Add the SSH key in your environment
ssh-add .ssh/id_rsa
Keywords: #organisation #GitHub #permissions #members #push
Run the following command to update rights of all users except GitHub teams and GitHub administrators, for all projects. Permissions will be set to "push", i.e. "write".
bash GitHubWizard.sh set-users-permissions-to-push
Keywords: #organisation #GitHub #permissions #teams #push
Run the following command to update rights of all teams, for all projects. Permissions will be set to "push", i.e. "write".
bash GitHubWizard.sh set-teams-permissions-to-push
Keywords: #organisation #GitHub #permissions #teams #read
Run the following command to update rights of all teams, for all projects. Permissions will be set to "read".
bash GitHubWizard.sh set-teams-permissions-to-read