Skip to content

[BUG]: Resource github_organization_ruleset knows nothing about attribute required_workflows after creation of the Rule(s) #2113

Closed

Description

@ViacheslavKudinov

Expected Behaviour

Terraform state has information about an attribute required_workflows of the github_organization_rulesett resource.

Actual Behaviour

State DOES NOT include information about required_workflows attribute of github_organization_ruleset resource.

Terraform Version

Terraform v1.7.0 on linux_amd64
GH Provider registry.terraform.io/integrations/github v5.45.0

Affected Resource(s)

  • github_organization_ruleset

Terraform Configuration Files

resource "github_organization_ruleset" "required-workflow-depricated-actions" {
  name        = "Required workflow for Deprecated Actions"
  target      = "branch"
  enforcement = "evaluate"

  conditions {
    ref_name {
      include = ["~DEFAULT_BRANCH"]
      exclude = []
    }
    repository_name {
      include = [
        "test-repo"
      ]
      exclude = []
    }
  }

  rules {
    required_workflows {
      required_workflow {
        repository_id = 123456 # change to real repo_id or use "data"
        path          = ".github/workflows/deprecated_actions.yaml"
        ref           = "master"
      }
    }
  }
}

Steps to Reproduce

terraform apply
terraform plan
terraform state show 'github_organization_ruleset.required-workflow-depricated-actions'

output of plan (tries to add required_workflow again)

  ~ resource "github_organization_ruleset" "required-workflow-depricated-actions" {
        id          = "CENSORED"
        name        = "Required workflow for Deprecated Actions"
        # (5 unchanged attributes hidden)

      ~ rules {
            # (6 unchanged attributes hidden)

          + required_workflows {
              + required_workflow {
                  + path          = ".github/workflows/deprecated_actions.yaml"
                  + ref           = "master"
                  + repository_id = CENSORED
                }
            }
        }

        # (1 unchanged block hidden)
    }

output of state (empty rules object)

# github_organization_ruleset.required-workflow-depricated-actions:
resource "github_organization_ruleset" "required-workflow-depricated-actions" {
    enforcement = "evaluate"
    etag        = "CENSORED"
    id          = "CENSORED"
    name        = "Required workflow for Deprecated Actions"
    node_id     = "CENSORED"
    ruleset_id  = CENSORED
    target      = "branch"

    conditions {
        repository_id = []

        ref_name {
            exclude = []
            include = [
                "~DEFAULT_BRANCH",
            ]
        }

        repository_name {
            exclude   = []
            include   = [
              "test-repo"
            ]
            protected = false
        }
    }

    rules {
    }
}

Debug Output

No response

Panic Output

No response

Code of Conduct

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

Activity

  1. added
    Status: Triage
    Type: Bug
    on Jan 22, 2024
  2. o-sama commented on Jan 22, 2024

    @o-sama
    Contributor

    Hey @ViacheslavKudinov, I'll try looking into this within the next couple of days, it's likely an issue with how the object is serialized. Thanks for bringing this up 🙂

  3. changed the title [-][BUG]: Resource `github_organization_ruleset ` knows nothing about attribute resource after creation of the Rule(s)[/-] [+][BUG]: Resource `github_organization_ruleset ` knows nothing about attribute `required_workflows ` after creation of the Rule(s)[/+] on Jan 22, 2024
  4. changed the title [-][BUG]: Resource `github_organization_ruleset ` knows nothing about attribute `required_workflows ` after creation of the Rule(s)[/-] [+][BUG]: Resource `github_organization_ruleset ` knows nothing about attribute `required_workflows` after creation of the Rule(s)[/+] on Jan 22, 2024
  5. ViacheslavKudinov commented on Jan 22, 2024

    @ViacheslavKudinov
    ContributorAuthor

    Thank you @o-sama, it will be great if you could fix it quickly.

  6. added
    Status: Up for grabs
    and removed
    Status: Triage
    on Jan 22, 2024
  7. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Jan 22, 2024
  8. ViacheslavKudinov commented on Mar 12, 2024

    @ViacheslavKudinov
    ContributorAuthor

    Is not reproducible on v6.0.1.

  9. kfcampbell commented on Mar 12, 2024

    @kfcampbell
    Contributor

    @ViacheslavKudinov feel free to close the issue if this has been fixed!

  10. ViacheslavKudinov commented on Mar 13, 2024

    @ViacheslavKudinov
    ContributorAuthor

    Thanks for the fix.

  11. 13 remaining items

  12. added
    Status: Stale
    on Jun 16, 2025
  13. ViacheslavKudinov commented on Jun 16, 2025

    @ViacheslavKudinov
    ContributorAuthor

    Still valid issue

  14. removed
    Status: Stale
    on Jun 17, 2025
  15. Noamshmueli commented on Jun 18, 2025

    @Noamshmueli

    Still experience the issue with provider version v6.6.0

  16. mbelang commented on Jul 21, 2025

    @mbelang

    There is a similar problem with bypass_mode. Terraform doesn't store if you specify pull_request.

  17. Netkracker commented on Aug 20, 2025

    @Netkracker

    We at @swisspost miss the feature to create organization rulesets without having permanent drift on the workspace this code runs on.

    Still happening on 6.4.0 (we needed to pin due to #2542 )

  18. builtroller commented on Sep 23, 2025

    @builtroller

    Bump on this.

  19. moved this from Backlog to On Deck in Terraform Provideron Oct 14, 2025
  20. moved this from On Deck to In Review in Terraform Provideron Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsType: Bug

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions