Last active
December 13, 2022 23:17
-
-
Save jhadev/363d3e873a212ed3c63f61ae3ad920b5 to your computer and use it in GitHub Desktop.
ZSH Create Repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GH_TOKEN="<YOUR TOKEN>" | |
export REPO_NAME="$USER-automated-repo" | |
create_repo() { | |
echo default $REPO_NAME | |
vared -c -p 'Please enter a repo name: ' REPO_NAME | |
echo new $REPO_NAME | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GH_TOKEN" \ | |
https://api.github.com/user/repos \ | |
-d'{"name":"'"$REPO_NAME"'"}' | |
set $REPO_NAME="" | |
echo DONE! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a Personal Access Token in https://github.com/settings/tokens