Skip to content

Instantly share code, notes, and snippets.

@brntbeer
Last active September 24, 2015 16:37
Show Gist options
  • Save brntbeer/6d3df43dc4f2abfbac76 to your computer and use it in GitHub Desktop.
Save brntbeer/6d3df43dc4f2abfbac76 to your computer and use it in GitHub Desktop.
Some instructions on running the team_audit.rb script from https://github.com/github/platform-samples
source 'https://rubygems.org'
gem 'octokit'

Link to script.

In order to run team_audit.rb you must have an environment capable of running Ruby scripts.

To get an instance wide audit follow these steps:

  1. Log in as the GHE Site Admin and generate a personal access token with at least read:org scope checked.
  2. SSH into the GHE VM and run ghe-org-owner-promote. This will make the site admin an owner in all organizations. Without this, the site admin account may not have sufficient permissions to run this script on all organizations.
  3. Set the GITHUB_TOKEN variable to the token you've just generated when creating the personal access token.
  4. Set the GITHUB_API_ENDPOINT variable to http(s)://[your-hostname]/api/v3/ replacing [your-hostname] with the hostname of your GitHub Enterprise installation.
  5. Download or copy the team_audit.rb file and Gemfile (located in this Gist) to a new folder on your machine.
  6. Run bundle install inside of that folder to retrieve the script's dependencies.
  7. Run the script to generate the audit report: ruby team_audit.rb <ORG> replacing <ORG> with the name of the organization you wish to run the report for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment