Skip to content

[BUG]: Since 6.0.1 the github_actions_repository_permissions resource errors on read when it's disabled #2182

@stevehipwell

Description

@stevehipwell

Expected Behavior

When a github_actions_repository_permissions resource is set to disabled it should be able to be read correctly.

Actual Behavior

We're getting the following error when we have a github_actions_repository_permissions resource set to disabled.


│ Error: GET https://api.github.com/repos/my-org/test/actions/permissions/selected-actions: 409 []

│ with module.repo["test"].github_actions_repository_permissions.default,
│ on modules/repo/main.tf line 72, in resource "github_actions_repository_permissions" "default":
│ 72: resource "github_actions_repository_permissions" "default" {

I suspect that this has been caused by the changes in 97d5113.

Terraform Version

Terraform v1.5.7
on linux_amd64

  • provider registry.terraform.io/hashicorp/random v3.6.0
  • provider registry.terraform.io/integrations/github v6.0.1

Affected Resource(s)

  • github_actions_repository_permissions

Terraform Configuration Files

locals {
  actions_enabled = false
}

resource "github_actions_repository_permissions" "default" {
  repository      = "my-repo"
  enabled         = local.actions_enabled
  allowed_actions = local.actions_enabled ? "all" : null
}

Steps to Reproduce

No response

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

    Status: Up for grabsIssues that are ready to be worked on by anyoneType: 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