Skip to content

feat(repo-rulesets): add support for required reviewers in org and repo rs#3090

Closed
vperfilyev-vitech wants to merge 1 commit intointegrations:mainfrom
vperfilyev-vitech:feat/ruleset-required-reviewers
Closed

feat(repo-rulesets): add support for required reviewers in org and repo rs#3090
vperfilyev-vitech wants to merge 1 commit intointegrations:mainfrom
vperfilyev-vitech:feat/ruleset-required-reviewers

Conversation

@vperfilyev-vitech
Copy link
Copy Markdown

…on and repository rulesets

Resolves #3081


Before the change?

The pull_request rule in organization and repository rulesets did not support the required_reviewers field
Users could not configure specific teams to review changes to particular file patterns through Terraform
The "Required review by specific teams" feature (announced November 2025) was not available in the provider

After the change?

  • Added required_reviewers block to the pull_request rule for both github_organization_ruleset and github_repository_ruleset resources

  • Users can now specify teams that must approve changes to specific file patterns

  • Supports configuring:

    1. reviewer block with id (team ID) and type (currently only "Team" supported)
    2. file_patterns - list of fnmatch patterns (e.g., [".go", ".tf"])
    3. minimum_approvals - number of required approvals (0 = optional reviewer)
resource "github_repository_ruleset" "example" {
  name        = "example"
  repository  = github_repository.example.name
  target      = "branch"
  enforcement = "active"

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

  rules {
    pull_request {
      required_approving_review_count = 1

      required_reviewers {
        reviewer {
          id   = github_team.security.id
          type = "Team"
        }
        file_patterns     = ["*.go", "security/**"]
        minimum_approvals = 2
      }
    }
  }
}

Pull request checklist

  • Schema migrations have been created if needed (example)
  • 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
  • No

Additional Notes
This feature is currently in beta on GitHub's side and subject to change
Only Team reviewer type is supported (as per GitHub API)
Reference: GitHub Changelog - Required review by specific teams now available in rulesets

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@github-actions github-actions Bot added the Type: Feature New feature or request label Jan 18, 2026
@deiga
Copy link
Copy Markdown
Collaborator

deiga commented Jan 18, 2026

@vperfilyev-vitech Thanks for creating this! Note that there is already a PR for this feature: #3073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: PR policy - require reviewer from specific team

4 participants