When configuring a new repo consider the following.
NOTE: Be careful to follow the github instructions.
gh repo create my_repo --public
mkdir my_repo
git init[](https://conventionalcommits.org) [](https://github.com/pre-commit/pre-commit)
[](https://skillicons.dev)
NOTE: This repo has switched to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0). It requires `pre-commit` and `commitizen` to help with controlling this. # install pre-commmit (prerequisite for commitizen)
brew install pre-commit
brew install commitizen
# conventional commits extension
code --install-extension vivaxy.vscode-conventional-commits
# install hooks
pre-commit install --hook-type commit-msg --hook-type pre-pushClick Add File button in github portal. Type in name as LICENSE and choose the template you require.
More info on CODEOWNERS
* @chrisguest75
.github/* @chrisguest75Create a ./.github./workflows folder
mkdir -p ./.github./workflowsUse graphQL to create branch protections docs
export owner="chrisguest75"
export name="github-of-life"
repositoryId="$(gh api graphql -f query='{repository(owner:"'$owner'",name:"'$name'"){id}}' -q .data.repository.id)"
echo $repositoryId
# -F for int
# isAdminEnforced: false means I can override
gh api graphql -f query='mutation($repositoryId:ID!, $branch:String! $requiredReviews:Int!) {
createBranchProtectionRule(input: {
isAdminEnforced: false
repositoryId: $repositoryId
pattern: $branch
requiresApprovingReviews: true
requiredApprovingReviewCount: $requiredReviews
}) { clientMutationId }}' -f repositoryId="$repositoryId" -f branch="[main,master]*" -F requiredReviews=1