Skip to content

[BUG]: Approving PAT taints github_enterprise_organization #1914

@mgm-brandt

Description

@mgm-brandt

Expected Behavior

When using github_enterprise_organization, the permissions should work on first apply and not taint the resource when giving permissions.

Actual Behavior

Creating a github org with github_enterprise_organization fails after creation because of PAT permissions:

│ Error: PATCH https://api.github.com/orgs/example: 403 Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization. []
│ 
│   with github_enterprise_organization.default["example"],

When approving access for the PAT, the resource becomes tained.

  # github_enterprise_organization.default["example"] is tainted, so must be replaced
-/+ resource "github_enterprise_organization" "default" {
      + description   = "Example"
      ~ id            = "O_XXX" -> (known after apply)
        name          = "example"

Terraform Version

% terraform -version
Terraform v1.5.2
on darwin_arm64
+ provider registry.terraform.io/integrations/github v5.37.0

Affected Resource(s)

  • github_enterprise_organization

Terraform Configuration Files

No response

Steps to Reproduce

% terraform apply

Debug Output

No response

Panic Output

No response

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions