This script was used to create repos within an organization under a GitHub enterprise account.
To use this script, you first need an OAuth token. This can be obtained by opening up your terminal and executing the following command:
curl -i -u <username> -d '{"scopes":["repo","user"], "note":"getting-started"}' https://hostname/api/v3/authorizations
where:
<username>is your username within the organisationhostnameis your enterprise GitHub URL- Parameters for
scopescan be found here
The OAuth token is generated and displayed just ONCE. Please treat this as a password (since this uniquely authenticates you) and store it somewhere safe.
At lines 13, 23, 35, 45 please make note of the arguments.
<token>is where you replace with the OAuth token that you obtained in the previous step{org-name}is the organisation where you wish to create your repositories.hostnameis your GitHub Enterprise URL
Output generated by the cURL commands have been saved in a file called output_log.txt
To run this file, simply navigate to the path where the file is present and execute the following command:
sh sample_script.sh
The GitHub Developer Guide was one of the most helpful resources !