-
Notifications
You must be signed in to change notification settings - Fork 772
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
Support personal repositories not only GitHub organization #45
Comments
Any updates on this? |
Related to #77 |
Any update on this? It would be great! |
the I was able to get Looking at the API Docs there is a different URL endpoint for creating in an org ( |
Having the possibilty to create and manage personal repositories from TF would be amazing, especially for demos. Any updates down the line? |
Hello there, https://github.com/p0bailey/terraform-github-personal-repositories |
Any updates on this? |
Everything seems blocked. |
i am using
where organization is the |
this worked for me. With version
|
I am unable to confirm @mrtazz's success: Provider
provider "github" {
version = "~> 2.4"
individual = true
}
Applying
resource "github_repository" "test" {
name = "terraform-github_branch-test"
}
Importing
resource "github_repository" "test" {
name = "go-travis-testing"
}
Fixing this should close #50, #56, and #96. @shoekstra @jcudit pinging you because I stumbled into this while attempting to test importing with |
@cornfeedhobo you need to set |
@mrtazz I tried that as well and it fails too. provider "github" {
individual = false
organization = "cornfeedhobo"
}
resource "github_repository" "test" {
name = "terraform-github_branch-test"
}
Like others point out above, it's impossible because the API's Edit: same thing if |
hmm that's curious. My provider config looks like this
And with that I was able to import all of my repos as well as set some things as mentioned in https://github.com/terraform-providers/terraform-provider-github/issues/45#issuecomment-603794145. |
Strange indeed! Every combination in the provider has failed for me
|
@mrtazz are you exporting anything other than |
For Personal repos this works. It only works with 2.4.0 though, 2.4.1 and 2.5.0 break it.
|
Interesting. As I sit here and finish a PR, I can already see how big of a fix this could end up being. I'll have to think about this a little. Maybe it would be best to fix a one or a few resources at a time. Limit the blast radius of each PR. |
To add some wider context, a I initially thought GraphQL support would be a cause for a major version bump as well. However, there is a plan to incrementally add support. If we are to take a similar approach, comprehensive acceptance testing and state migration coverage will be needed to 🚢 this feature incrementally. |
@cornfeedhobo I don't have any other environment variables set. @ozthegreat oh that's weird. I'm definitely running 2.4.1
|
this doesn't work in 2.6.0 either |
Doesn't work for me with a personal repo either. Hopefully this information helps get this resolved. I've tried 2.4 and 2.6. The issue with 2.4 is different to 2.6 it seem and might be caused by the GH API changing. With provider version 2.4.0 With provider version 2.6.0 Here are the two relevant fragments of my Terraform
|
@janaka Did you check to make sure your token has the right permissions? you'll need repo admin when create you personal access token. This is using with provider version 2.4.0. |
Pretty sure perms are good. I'll need to double check as it's been some days. |
FYI - I moved the repo from my personal to an Org (the personal account owns) and all is now working. Same token with no perms changes. Provider 2.6.1. |
@jcudit can you add this to v2.9.0 https://github.com/terraform-providers/terraform-provider-github/milestone/8?closed=1 milestone? |
Sorry, what is the fix here for the
|
@clebio pretty sure this was reverted |
Given orgs became free around the same time, I just created one and moved my repo there. |
I'm now having the issue - @cornfeedhobo - how do you know it was reverted? I cannot easily create an organization because I'm part of a few already. |
Any idea what the workaround is for personal repositories for now? |
@josjaf there is none that I know of right now. Sounds like most people have created orgs for the meantime. |
@josjaf I moved to GitLab. |
* Constantly giving the error "error: This resource requires GitHub organization to be set on the provider." * See https://github.com/terraform-providers/terraform-provider-github/issues/45
This issue is now resolved now as per the provider version v4.1.0, you can create a github repo in your personal profile as
Thanks Community for fixing this issue. |
Terraform Version
v0.9.5
Affected Resource(s)
Terraform Configuration Files
Debug Output
terraform.tfstate
Expected Behavior
It should create repository under personal account and write state in
terraform.tfstate
Actual Behavior
terraform
asksGithub oraganization
when running withterraform apply
. Also it returns422
when running twice. So it isn't idempotent.Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: