Skip to content

Discussion: split rules into branch_rules, push_rules etc. in ruleset resources #3584

Open

Description

@deiga

Our ruleset resources currently have a rules Set just the GitHub API accepts it. This requires us to write custom validation logic for rules which are allowed only with a specific target.
To make validations and UX simpler, I'm suggesting to split the rules attribute into something like branch_rules, tag_rules, push_rules etc.

This would remove the need for us to validate which rule is allowed with with target and it would be clearer for our users as well that rules relate to targets.

On the shoulders of https://github.com/integrations/terraform-provider-github/pull/3110/changes#r2827158611: What if we split the rules into separate lists based on which target they work with?

That would enable us to remove the rules validation for "is this target allowed to set this rule" and replace it with simpler built-in validators.
It would make the UX for our users nicer since they don't have to trial-and-error the rules.

Originally posted by @deiga in #3110 (comment)

Activity

  1. added
    Needs DiscussionThis issue/PR needs maintainers to discuss and decide on a course of action.
    on Jul 28, 2026
  2. github-actions commented on Jul 28, 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.

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

    Needs DiscussionThis issue/PR needs maintainers to discuss and decide on a course of action.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions