Skip to content

github_branch_protection requires branch to exist #164

Closed

Description

@abridgett

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.

Activity

  1. estahn commented on Dec 11, 2018

    @estahn

    @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).

  2. added a commit that references this issue on Feb 7, 2019
  3. patrickmarabeas commented on Feb 10, 2020

    @patrickmarabeas
    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

  4. added a commit that references this issue on Jul 26, 2022
  5. github-actions commented on Dec 11, 2022

    @github-actions

    👋 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!

  6. added
    Status: Stale
    on Dec 11, 2022
  7. kfcampbell commented on Dec 12, 2022

    @kfcampbell
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleUpstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions