PowerShell script for automated repository creation and initialization
- Create an access token for command-line use (For details see here)
- Necessary scopes
repo
write:org
(For creation of repos for an organization)
- Necessary scopes
- Check out the sources from the
PS.GitHub.RepoCreator
repository - Navigate to the
src
folderConfig.xml
: Fill in your GitHub username and the access token generated in step 1NOTICE_Template
: Adjust the content according your wishes (IMPORTANT: The placeholdersREPONAME
andREPODESCRIPTION
always have to occur at least once in the file)README_Template
: Adjust the content according your wishes (IMPORTANT: The placeholdersREPONAME
,LICENSESHIELD
,NUGETVERSIONSHIELD
andREPODESCRIPTION
always have to occur at least once in the file)
- Now you're ready to execute the script which will do the following
- Creation of a new repository with the selected license and the selected gitignore file
- In case you selected
Apache 2.0
as license, it will add a license badge to the README file - Creation of a NOTICE file based on the
NOTICE_Template
- Creation of 3 new issue labels:
feature
,onhold
,task
Sample invocation
PS C:\PS.GitHub.RepoCreator\src> .\New-GitHubRepo.ps1 -RepoName 'NAME' -RepoDescription 'DESCRIPTION'
<?xml version="1.0"?>
<Configuration>
<GitHub>
<Username>USERNAME</Username>
<Token>TOKEN</Token>
</GitHub>
</Configuration>