You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Approving PAT taints github_enterprise_organization #1914
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"
👋 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!
Activity
github-actions commentedon Jun 20, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!ericpardee commentedon Dec 26, 2025
We just hit this exact bug today (Dec 26 2025) on provider
v6.8.3.Scenario:
terraform applyto create newgithub_enterprise_organizationin EMU environmentterraform applyagainEvidence from GitHub audit logs:
No config changes between creation and deletion. The taint was triggered by the PAT authorization flow.
Impact: Deleted org enters 90-day soft-delete. Required GitHub support ticket to release the name.
Workaround: Adding
lifecycle { prevent_destroy = true }to the resource so Terraform errors instead of destroying.This bug was closed by stalebot, not fixed. Requesting reopen.
fix(enterprise_organization): prevent taint when PAT not yet authorized
fix(enterprise_organization): prevent taint when PAT not yet authorized
fix(enterprise_organization): prevent taint when PAT not yet authorized
fix(enterprise_organization): prevent taint when PAT not yet authorized
fix(enterprise_organization): prevent taint when PAT not yet authorized
fix: Prevent enterprise org taint on SAML enforcement error
fix: Prevent enterprise org taint on SAML enforcement error
fix: Prevent enterprise org taint on SAML enforcement error
fix: Prevent enterprise org taint on SAML enforcement error (#3026)
fix: Prevent enterprise org taint on SAML enforcement error (integrat…