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

github_branch_protection not working on user repos #561

Closed
ahmadnassri opened this issue Oct 1, 2020 · 2 comments
Closed

github_branch_protection not working on user repos #561

ahmadnassri opened this issue Oct 1, 2020 · 2 comments
Labels
Awaiting response r/branch_protection Type: Bug Something isn't working as documented

Comments

@ahmadnassri
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v0.13.4
+ provider registry.terraform.io/-/github v3.0.0
+ provider registry.terraform.io/hashicorp/github v3.0.0

Affected Resource(s)

Please list the resources as a list, for example:

  • github_branch_protection

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

my tf file is a custom module and is functional when using with orgs, but when trying to operate the same config for a user account owner = 'ahmadnassri' it throws an error that branch protection is not supported for user accounts

Debug Output

Error: This resource can only be used in the context of an organization, "ahmadnassri" is a user.

  on module/main.tf line 50, in resource "github_branch_protection" "branch_protection":
  50: resource "github_branch_protection" branch_protection {

Expected Behavior

should allow branch protection to run on user repos

Actual Behavior

branch protection does not run for user repos

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
@ahmadnassri ahmadnassri changed the title github_branch_protection not working on user accounts github_branch_protection not working on user repos Oct 1, 2020
@jcudit
Copy link
Contributor

jcudit commented Nov 25, 2020

I believe this was fixed by https://github.com/terraform-providers/terraform-provider-github/issues/501. @ahmadnassri can you confirm whether or not your use case is still affected?

@jcudit jcudit added Type: Bug Something isn't working as documented r/branch_protection Awaiting response labels Nov 25, 2020
@ahmadnassri
Copy link
Author

yes this is now functional. closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting response r/branch_protection Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

2 participants