Skip to content

[BUG]: github_repository_ruleset repository is optional #2561

@matijs

Description

@matijs

Expected Behavior

According to the documentation, repository is optional.

Actual Behavior

While the plan succeeds, the apply fails horribly:

Error: POST https://api.github.com/repos/OWNER//rulesets: 404 Not Found []

Mind the double // which maybe suggest that a repository is missing and maybe shouldn't be optional.

Terraform Version

Terraform v1.10.5
on linux_amd64

  • provider registry.terraform.io/integrations/github v6.5.0

Affected Resource(s)

  • github_repository_ruleset

Terraform Configuration Files

resource "github_repository_ruleset" "required-linear-history" {
  enforcement = "active"
  name        = "require-linear-history"
  target      = "branch"

  rules {
    required_linear_history = true
  }
}

Steps to Reproduce

terraform apply

I'm running this on HCP Terraform and not locally, it seems that terraform plan works, but terraform apply fails.

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions