Skip to content

ankitanallana/Bash-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

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 organisation
  • hostname is your enterprise GitHub URL
  • Parameters for scopes can 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.


sample_script.sh

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.
  • hostname is 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 !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages