Skip to content

Instantly share code, notes, and snippets.

@jhadev
Last active December 13, 2022 23:17
Show Gist options
  • Save jhadev/363d3e873a212ed3c63f61ae3ad920b5 to your computer and use it in GitHub Desktop.
Save jhadev/363d3e873a212ed3c63f61ae3ad920b5 to your computer and use it in GitHub Desktop.
ZSH Create Repo
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!
}
@jhadev
Copy link
Author

jhadev commented Oct 12, 2022

Create a Personal Access Token in https://github.com/settings/tokens

Enjoy living the shell life
coopy

@jhadev
Copy link
Author

jhadev commented Oct 12, 2022

Create a Personal Access Token in https://github.com/settings/tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment