showyourwork / showyourwork

A workflow for reproducible and open scientific articles

Home Page:https://show-your.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically create GitHub repo

MilesCranmer opened this issue · comments

Right now when you create a new project you have to manually go to GitHub and create a new repo. This is a small annoyance and might introduce some errors since you need to enter the repo’s name twice.

So I’d propose that the creation be done automatically (interactively) by syw. I’m not sure what the standard way is to do that but it looks like there’s either

curl -u 'USER:ACCESS_TOKEN' https://api.github.com/user/repos -d '{"name":"REPO"}'

or with the gh CLI, which seems more robust:

gh repo create REPO

with either --public or --private as the flag. (Running gh auth would authenticate the tool)

Thoughts @dfm?

I'm a -1 on this in the long term. My goal is to remove the tight integration with GitHub specifically (e.g. #296). But, if you're interested, I'd be perfectly happy to review a PR adding this as an optional feature in showyourwork setup. I wouldn't want to depend on the gh CLI, which isn't currently a dependency, but it shouldn't be a problem to ask the user for an access token at the command line.

I trust your wisdom on this! Maybe in the future the GitHub integration could be one of several “plugins” to a core ShowYourWork repo? I like how PkgTemplates.jl handles this sort of thing: https://github.com/JuliaCI/PkgTemplates.jl, with a variety of plugins to choose from, including GitHub-specific and GitLab-specific plugins. Each of which is managed in a separate repo.

In any case I think the GitHub plug-in would be nicer if it could create the repo automatically!

“good first issue” 😅

lol maybe not 🤣