terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[MAINT] Fix `github_organization_ruleset` with `push` target

Open deiga opened this issue 3 weeks ago • 1 comments

[!WARNING] This PR is "stacked" on top of https://github.com/integrations/terraform-provider-github/pull/2976 Currently relevant commits are after 3752c16 (This might link to correct changeset: https://github.com/integrations/terraform-provider-github/pull/2958/files/519ea54cdb3035806fb28caa2ab6fd0002209b0f..97e235105dcd2dafd1606451729325de56a694c9)

Resolves #2929, #2467


Before the change?

  • The provider would crash from a 422 error response when following the example in the docs
  • Removing ref_name would cause the provider to Panic as ref_name is a required field

After the change?

  • The provider should correctly apply push rulesets to an organization
  • ref_name should no longer be needed to be set for push target
  • conditions & target validation logic should ensure correct fields are populated

Pull request checklist

  • [ ] ~Schema migrations have been created if needed (example)~
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • [ ] Yes
  • [x] No

deiga avatar Dec 02 '25 20:12 deiga

@stevehipwell Yes, I agree. I've done that already in this PR: https://github.com/integrations/terraform-provider-github/pull/2976

But I can't switch the base of this PR to point to that :)

deiga avatar Dec 10 '25 13:12 deiga