terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[BUG]: Disabling the GH actions at organization or enterprise level is not supported

Open mauromedda opened this issue 4 months ago • 0 comments

Expected Behavior

When using the github_actions_organization_permissions or github_enterprise_actions_permissions by providing the required arguments: enabled_repositories = "none" https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_organization_permissions#enabled_repositories enabled_organizations = "none" (https://registry.terraform.io/providers/integrations/github/latest/docs/resources/enterprise_actions_permissions#enabled_organizations)

no other attributes should provided and the actions get disabled at enterprise or organization level.

Actual Behavior

The actual behaviour is the same with both │ Error: PATCH https://api.github.com/orgs/orgname: 422 [] │ │ with module.complete.github_organization_settings.this, │ on ../../main.tf line 6, in resource "github_organization_settings" "this": │ 6: resource "github_organization_settings" "this" { │ ╵ ╷ │ Error: PUT https://api.github.com/orgs/orgname/actions/permissions: 422 Invalid request. │ │ is not a member of ["all", "local_only", "selected"]. [] │ │ with module.complete.github_actions_organization_permissions.this[0], │ on ../../main.tf line 169, in resource "github_actions_organization_permissions" "this": │ 169: resource "github_actions_organization_permissions" "this" { │

The provider is passing to the API a wrong combination of allowed_organizations or repositories and allowed_actions values.

Terraform Version

Terraform v1.9.6 on linux_amd64

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

Affected Resource(s)

  • github_actions_organization_permissions
  • github_enterprise_actions_permissions

Terraform Configuration Files

resource "github_actions_organization_permissions" "this" {
  enabled_repositories = "none"
}

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

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

mauromedda avatar Sep 28 '24 07:09 mauromedda