You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEAT]: Support the code_quality rule and require_extra_approval_for_unattributed_changes in rulesets #3664
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
Reacted by katsukichi, Dimitris Christou, Jason Ouellet, Yarden Sachs, Félix Dorn, Gor Grigoryan and Thomas Han
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.
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.
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
Activity
github-actions commentedon Oct 4, 2026
👋 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.
gatsukichi commentedon Oct 7, 2026
plz
anthonymastreanvae commentedon Oct 14, 2026
We hit the same gap on
github_organization_ruleset(GHE.com with Enterprise Managed Users). Our existing org rulesets setrequire_extra_approval_for_unattributed_changes: trueon thepull_requestrule. To adopt them we had to setlifecycle { ignore_changes = all }, because any update from Terraform would send the rule without that setting.On
main,expandRulesingithub/util_rules.gobuildsgithub.PullRequestRuleParametersfrom the schema's attributes, and the resource sends the whole rules list withUpdateRepositoryRuleset. The request therefore carries no value for the setting, and we expect GitHub to reset it tofalse. 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, sinceflattenRulesdoes not read the setting back.The fix probably starts in go-github. Its
PullRequestRuleParametersstruct ingithub/rules.gohas no field for the setting. That holds in v92.0.0, the version the provider'smainbranch pins, and on go-githubmasteras of 2026-10-14. The provider can add the schema attribute once a go-github release carries the field.🤖 Generated with Claude Code
outring commentedon Oct 27, 2026
go-githubsupport forrequire_extra_approval_for_unattributed_changesis 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 #3685docs(adr): record GitHub settings as OpenTofu code the owner applies (#…
apps: github-apply restores the ruleset fields the provider does not …