This is a collection of scripts to automate GitHub Enterprise workflows using the GitHub Enterprise API.
To interact with the API the scripts mostly use octokat.js.
- Create a user. Add it to
<teamName>in all instance organizations - Create an Org. Create a team
<teamName>in the Org with Push and Pull rights. Add all users to this new team.
To run scripts (1) and (2) you'll need:
- a site admin account (GHE_ADMIN environment variable)
- a [personal access token](personal access token) (GHE_TOKEN) with scope
admin:org
The site admin still needs to be an owner of each organisation for the scripts to be effective across the whole instance. The easiest way to achieve this is to run ghe-org-owner-promote -u <admin-username> on the VM command line. You can also do it manually but that can be a tedious job if your instance has too many Orgs.
The script requires 3 variables:
-hhostname:-h yourGitHubEnterpriseDomain.net- Environment variable GHE_USER or
-uoption - Environment variable GHE_TOKEN or
-toption
Using -u or -t overrides the ENV variables.
git clone <repo_url>
npm install
export GITHUB_USER=<site admin username>
export GITHUB_TOKEN=<admin personal access token>
./github.js -h yourGitHubEnterpriseDomain.netIf you've setup your environment variables you should be good to go, otherwise set them inline with option -u and -t
This is a simple project with no build. Simply:
git clone <repo or fork>
npm installIf you want to test octokat.js calls with a minimum rig, run node and paste this line in:
var Octokat = require('octokat'); octo = new Octokat({ username: process.env.GITHUB_USER , password: process.env.GITHUB_TOKEN,rootURL: 'https://yourghedomain.com/api/v3'});var cb = function (err, val) { console.log(val);};Then you can run quick test queries like:
octo.me.fetch(cb)
