Skip to content

Conversation

@Dawo9889
Copy link
Contributor

This pull request introduces a new, modular Terraform setup for managing GitHub repository rulesets in production. The changes enable defining rulesets as variables and applying them to multiple repositories in a scalable and reusable way, using modules and submodules.

Key changes:

1. Infrastructure as Code Improvements

  • Added variables for repository_names and complex rulesets in github-repositories-ruleset-variables.tf, allowing flexible configuration of which repositories receive which rulesets and how those rulesets are defined.
  • Created a top-level module invocation in github-repositories-ruleset.tf to apply the rulesets to each repository listed in repository_names.

2. Module Structure and Reusability

  • Defined a new github-repository module, which takes a repository name and a list of rulesets, and delegates to a ruleset submodule for each ruleset. [1] [2]
  • Introduced variables in both the main and submodule for passing repository and ruleset details, ensuring type safety and clarity. [1] [2]

3. Ruleset Resource Management

  • Implemented the github_repository_ruleset resource in the ruleset submodule, supporting a wide range of rules (branch protection, pull request, status checks, merge queue, etc.) and conditions, with dynamic blocks for optional features.

These changes make it much easier to manage and scale repository rules across multiple GitHub repositories in a consistent, DRY (Don't Repeat Yourself) manner.

@kyma-bot

This comment has been minimized.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants