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 requires branch to exist #164

Closed
abridgett opened this issue Oct 26, 2018 · 5 comments
Closed

github_branch_protection requires branch to exist #164

abridgett opened this issue Oct 26, 2018 · 5 comments
Labels
Status: Stale Used by stalebot to clean house Upstream

Comments

@abridgett
Copy link

Terraform Version

0.11.10

Affected Resource(s)

  • github_branch_protection

Expected Behavior

A branch protection rule should be created for the branch (or fnmatch wildcard) in question

Actual Behavior

github_branch_protection.release-branch-protection: PUT https://api.github.com/repos/foo/bar/branches/release/protection: 404 Branch not found []

Important Factoids

I wonder if this is a limitation of the github API, the request being sent matches what you'd expect from https://developer.github.com/v3/repos/branches/#update-branch-protection
It is possible to do this from the UI though.

@estahn
Copy link

estahn commented Dec 11, 2018

@abridgett We have the same issue and I guess you would need to use auto_init. But we can't use auto_init because that would destroy our existing repos (#155).

jordane added a commit to jordane/terraform-provider-github that referenced this issue Feb 7, 2019
After PR integrations#135, auto_init, license_template, and gitignore_template now all
have ForceNew set to true, which means they *will* affect the resource after
initial creation. See also PR integrations#148, integrations#155, integrations#164

Signed-off-by: Jordan Evans <[email protected]>
@jonathanan
Copy link

jonathanan commented Feb 14, 2019

@patrickmarabeas
Copy link
Contributor

Github v4 API provides the ability to specify a pattern rather than a branch.

I have uplifted the resource to use the v4 API: https://github.com/terraform-providers/terraform-provider-github/pull/337

kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this issue Jul 26, 2022
After PR integrations#135, auto_init, license_template, and gitignore_template now all
have ForceNew set to true, which means they *will* affect the resource after
initial creation. See also PR integrations#148, integrations#155, integrations#164

Signed-off-by: Jordan Evans <[email protected]>
@github-actions
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Dec 11, 2022
@kfcampbell
Copy link
Member

Closing as #337 has been merged/released. Please create a new issue for further problems with this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house Upstream
Projects
None yet
Development

No branches or pull requests

6 participants