Skip to content

[BUG]: 409 response when destroying github_actions_repository_permissions #2681

Closed

Description

@trjstewart

Expected Behavior

When destroying a github_actions_repository_permissions resource, the provider should do so in a compliant way as to not result in an error when Actions permissions / policies are enforced at the Enterprise or Organization level.

Actual Behavior

The provider throws Error: PUT https://ndia.ghe.com/api/v3/repos/<organization>/<repository>/actions/permissions: 409 [] when attempting to delete the resource.

Taking a look at the API docs, this is expected behaviour when there is a conflict in overarching settings enforced by the Organization (or Enterprise in our case).

Looking at the source for the delete of this resource, it assumes what the default settings should be to return to - which are invalid for us.

Terraform Version

Terraform v1.12.1
on darwin_arm64

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

Affected Resource(s)

  • github_actions_repository_permissions

Terraform Configuration Files

resource "github_actions_repository_permissions" "default" {
  repository      = github_repository.default.name
  enabled         = var.actions # In this scenario, this is true.
  allowed_actions = var.actions ? "selected" : null # This is managed at the enterprise level
}

Steps to Reproduce

terraform apply
terraform destroy

Debug Output

Panic Output

Code of Conduct

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

Activity

  1. added
    Type: Bug
    Status: Triage
    on Jun 10, 2025
  2. deiga commented on Mar 22, 2026

    @deiga
    Collaborator

    Question: What would you expect terraform destroy to do? Do you expect it to be able to fetch your Enterprises allowed default values and set to those? Swallow the error of the destroy failure? Allow you to input default values to set on destroy? Something else, what?

  3. added
    Status: Needs info
    and removed
    Status: Triage
    on Mar 22, 2026
  4. trjstewart commented on Mar 23, 2026

    @trjstewart
    Author

    That's a rather good question.

    I think the cleanest option as a first step is to honor that allowed_actions is optional. If it has not been set, don't try to set it on delete.

  5. removed
    Status: Needs info
    on Oct 15, 2026
  6. self-assigned this
    on Oct 15, 2026
  7. added this to the v6.14.0 milestone on Oct 15, 2026
  8. stevehipwell commented on Oct 15, 2026

    @stevehipwell
    Collaborator

    If the delete call gets a 409 error it should complete successfully.

  9. moved this from Backlog to In Progress in Terraform Provideron Oct 15, 2026
  10. moved this from In Progress to Done in Terraform Provideron Nov 23, 2026
  11. moved this from 🆕 Triage to ✅ Done in 🧰 Octokit Activeon Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bugr/actions_repository_permissions

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions