Add OpenTofu module for GitHub repo guard-rails

Manages branch protection ruleset and deployment environments for this
repository. Mirrored to JMR-dev/gh-repo-bootstrap as a reusable module
+ gh CLI extension.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jason Ross
2026-04-29 18:30:45 -05:00
co-authored by Copilot
parent 4abb613f35
commit 037edd905a
9 changed files with 218 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
variable "repo_owner" {
description = "GitHub user or organization that owns the repository."
type = string
}
variable "repo_name" {
description = "Repository name (without owner prefix)."
type = string
}
variable "default_branch" {
description = "Branch protected by the ruleset."
type = string
default = "main"
}
variable "required_reviews" {
description = "Number of required approving reviews on PRs targeting the default branch."
type = number
default = 1
}
variable "require_signed_commits" {
description = "Require signed commits on the protected branch."
type = bool
default = false
}
variable "environments" {
description = "List of GitHub deployment environments to ensure exist."
type = list(string)
default = []
}
variable "ruleset_name" {
description = "Name to give the branch protection ruleset."
type = string
default = "default-branch-protection"
}