Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Variables for template repositories #1716

Open
mwarkentin opened this issue Jan 13, 2020 · 16 comments
Open

Variables for template repositories #1716

mwarkentin opened this issue Jan 13, 2020 · 16 comments

Comments

@mwarkentin
Copy link

Now that github has template repositories, an obvious next step is to enable "variables" to make it easy to stamp out customized repositories based on a set of metadata passed in to the template.

See https://cookiecutter.readthedocs.io for an example of this in a command line tool.

@chalu
Copy link

chalu commented Apr 13, 2020

I need this badly. Is it been looked into?

@usagiga
Copy link

usagiga commented May 10, 2020

Any news?
I don't want to replace variables manually.

@bastienrobert
Copy link

bastienrobert commented Jun 9, 2020

Another example of a great implementation of variables for templates could be Heroku: https://devcenter.heroku.com/articles/heroku-button#invoke-app-setups

@farinasa
Copy link

farinasa commented Dec 8, 2020

Any updates? This could be extremely helpful.

@itsjavi
Copy link

itsjavi commented Jan 24, 2021

I also think this is a must-have to make this feature really useful.
I propose to have it in a new section/tab of the template repository settings:

  • a section where to put the substitution keys (they will be asked to the developer when generating a new project based on the template)
  • a section to add glob wildcards for the files that will be processed in the generated project

@sr-nu
Copy link

sr-nu commented Jan 25, 2021

Need a way to:

  • Update the template project
  • Variables that can be replaced easily during cloning/post cloning.

@sustacek
Copy link

Need a way to:

  • Update the template project

I second this. I think it's important to give some (reasonably easy) way to match (update) an older project, so that's in line with a newer version of the template. At least some simple scenarios, like "one file gets updated in the template (and this is still present in the target project repository)". Since this will most likely mean conflicts, hopefully some conflict-resolution (with manual decisioning process) will be possible.

@itsjavi
Copy link

itsjavi commented Jan 25, 2021

@sustacek It would be very convenient to sync them similarly to Pull Requests, but the derivated project might become so different from the template that it will produce lots of conflicts and changed files most likely.

@sustacek
Copy link

@itsjavi, some process like PR would be lovely. Conflicts would be expected, this is like merging / rebasing between branches during development -- if two devs worked on the very same piece of code (lines in a file), someone has to decide what should be the end result. This can work well only for stable templates and projects not customized drastically after being created from that template.

Right now, when I need to update a project, I do a directory diff between the template repo and project repo. In an actual project, I mostly add new files and don't change the existing directory structure too much, to make my (future) life easier.

@chriss2401
Copy link

Any update on whether this would ever be implemented ?

@mwarkentin
Copy link
Author

Came across this: https://stefanbuck.com/blog/repository-templates-meets-github-actions

@sebacruz
Copy link

sebacruz commented May 5, 2021

Any update on this?

@stevenpollack
Copy link

Definitely would like to see variables in use -- at the very least for things like README's and package.json's...

@robertohein
Copy link

it would be very useful, looking foward to it!

@paulbijancoch
Copy link

Hey everyone, I am working on http://codeboard.world to solve exactly this.
Please reach out at paulbijancoch@gmail.com, if you are interested.

@mwarkentin
Copy link
Author

I came across this today which uses a 1-time Github Action to do some variables: https://github.com/rochacbruno/python-project-template/blob/main/.github/workflows/rename_project.yml

I've also opened a discussion on the official feedback forum, please upvote there! community/community#5336

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests