Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to opt out of #166 #848

Open
futursolo opened this issue Jan 15, 2023 · 1 comment
Open

Provide a way to opt out of #166 #848

futursolo opened this issue Jan 15, 2023 · 1 comment

Comments

@futursolo
Copy link

futursolo commented Jan 15, 2023

Since #166, the generated template now has the same default branch name as the generated template.
This sometimes can create some issues for templates stored in main branch that matches the code in main branch.

What I want to achieve:

  1. Templates in main branch matches crates in main branch.
    So GitHub Actions can be run to validate the templates on pull requests.
  2. Templates of the released version is copied to the templates branch by GitHub Actions upon a release.
    Version numbers inside templates are modified by GitHub Actions automatically by appending to a Rhai script.
    (I want to leverage the create release page from GitHub to create a release.
    At that time GitHub already tags the release so templates cannot be modified anymore.
    It's also a burden for the user to know the latest tag in order to generate from a template.)

However, repositories generated from the templates branch will have their default branch set to templates.

Is it possible to provide a way to specify the default branch name?

e.g.:

[template.vcs]
type = "git"
default_branch = "main"

So doing cargo generate user/project --branch templates will still result in a template with the main branch being created.

@sassman
Copy link
Member

sassman commented May 2, 2024

If I understand you correct:

  • given a template repo where templates live in the branch templates
  • you want to ensure that after using this template repo, users will not remain on the templates branch
  • further they instead should have the main as their active branch

is this correct?

And you are suggesting a configuration like so:

[template.vcs]
type = "git"
default_branch = "main"

in the template repo to configure the users "active" branch after they have used your template repo? Right?

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

No branches or pull requests

2 participants