Conversation
When creating a repository from a template, you can pass in a boolean to include all the branches in the template repo. This is documented here: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template In addition, the provider already supports that here: https://github.com/google/go-github/blob/3e8a7f0fbe0e4402f9ad5a80e0ab0a050786e0f8/github/repos.go#L441 Adding a variable under the template structure and then pass it in to the provider function works. Added tests to make sure it works. All tests are passing
38cc636 to
bc14aa3
Compare
|
@KensoDev do you mind allowing edits by maintainers? I'd like to merge main in and make some updates to the integration test, which is failing for me. If you'd prefer not to, I'm happy to open a new PR as well. Thanks! |
Happy to. How do I allow maintainers to do that? |
|
You should have a checkbox in the lower right corner of the Conversation page near the settings for your notifications. Here's an example of what I see on #1340: |
|
I do not have this option. Feel free to pull this work and create a new PR from it. |
|
@kfcampbell I manually added you with |
|
That's bizarre! I wonder why. For the tests: I'm following the instructions here and exporting When running with the error: testing.go:705: Step 0 error: Check failed: Check 1/1 error: github_repository.test: Attribute 'template.include_all_branches' not found`. Can you reproduce that error? (Some additional archiving integration tests are failing, but that's not related.) |
|
I'm really torn about the test for this. A good test would probably go fetch the github_branch data source for the repository and confirm that multiple branches were copied over. That might be particularly onerous since it requires a template repository set with multiple branches in the organization. |
|
@peter-murray I haven't forgotten about this. I'm tempted to merge and release this without an explicit test given the somewhat trivial nature of the actual change. |
|
@KensoDev are you sure you don't see a checkbox to give maintainers access anywhere on the PR? I'd like to play with this a bit and ideally wouldn't create a new PR so you'd become a contributor when this behavior is merged. |
|
100% sure. Tried both mobile and desktop. I don’t have that checkbox. Sent from my iPhoneOn Oct 27, 2022, at 5:06 PM, Keegan Campbell ***@***.***> wrote:
@KensoDev are you sure you don't see a checkbox to give maintainers access anywhere on the PR? I'd like to play with this a bit and ideally wouldn't create a new PR so you'd become a contributor when this behavior is merged.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Closing in favor of #1353. |

When creating a repository from a template, you can pass in a boolean to
include all the branches in the template repo.
This is documented here: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template
In addition, the provider already supports that here: https://github.com/google/go-github/blob/3e8a7f0fbe0e4402f9ad5a80e0ab0a050786e0f8/github/repos.go#L441
Adding a variable under the template structure and then pass it in to
the provider function works.
This PR includes tests + docs for the new addition. It is backward compatible with the previous behavior