Skip to content

[FEAT]: Support the code_quality rule and require_extra_approval_for_unattributed_changes in rulesets #3664

Description

@alunduil

Describe the need

I'm trying to bring an existing repository ruleset under Terraform and hit a gap I couldn't work around. The ruleset carries a code_quality rule ("parameters": {"severity": "errors"}) and its pull_request rule has require_extra_approval_for_unattributed_changes: true. As far as I can tell neither has a schema in v6.13.0 or on main, so after an import any change to the ruleset sends a rules list without them and GitHub drops them.

I'm not sure if these are just newer API fields nobody has wired up yet, or if there's a reason they've been left out. I worked around it by putting the rules I need in a separate ruleset, but that leaves the original unmanaged. If there's interest I'm happy to take a stab at adding them, though I'd want a pointer on how you'd like the rule parameters modelled.

GitHub Installation Type

  • GitHub.com (Free, Pro, or Team)

Relevant log output

No response

Code of Conduct

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

Activity

  1. github-actions commented on Oct 4, 2026

    @github-actions

    👋 Hi, and thank you for opening this issue!

    This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

    You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.


    🤖 This is an automated message.

  2. added
    Type: Feature
    Status: Triage
    on Oct 5, 2026
  3. added theissue type on Oct 5, 2026
  4. gatsukichi commented on Oct 7, 2026

    @gatsukichi

    plz

  5. anthonymastreanvae commented on Oct 14, 2026

    @anthonymastreanvae

    We hit the same gap on github_organization_ruleset (GHE.com with Enterprise Managed Users). Our existing org rulesets set require_extra_approval_for_unattributed_changes: true on the pull_request rule. To adopt them we had to set lifecycle { ignore_changes = all }, because any update from Terraform would send the rule without that setting.

    On main, expandRules in github/util_rules.go builds github.PullRequestRuleParameters from the schema's attributes, and the resource sends the whole rules list with UpdateRepositoryRuleset. The request therefore carries no value for the setting, and we expect GitHub to reset it to false. We have not confirmed the reset against the API, because we avoided the update rather than test it on a live ruleset. A plan would not show the change either, since flattenRules does not read the setting back.

    The fix probably starts in go-github. Its PullRequestRuleParameters struct in github/rules.go has no field for the setting. That holds in v92.0.0, the version the provider's main branch pins, and on go-github master as of 2026-10-14. The provider can add the schema attribute once a go-github release carries the field.

    🤖 Generated with Claude Code

  6. outring commented on Oct 27, 2026

    @outring

    go-github support for require_extra_approval_for_unattributed_changes is merged but not released yet, once it's released I will create a PR here, though it can be not that fast and easy, for some reason previous bump didn't happen #3685

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: TriageType: Featurer/organization_rulesetr/repository_ruleset

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions