Skip to content

Commit

Permalink
Protect main branch in quarkus-jgit
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Dec 4, 2024
1 parent d558168 commit 39e3361
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions terraform-scripts/quarkus-jgit.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,35 @@ resource "github_team_membership" "quarkus_jgit" {
username = each.value
role = "maintainer"
}

# Protect main branch using a ruleset
resource "github_repository_ruleset" "quarkus_jgit" {
name = "main"
repository = github_repository.quarkus_jgit.name
target = "branch"
enforcement = "active"

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

bypass_actors {
actor_id = data.github_app.quarkiverse_ci.id
actor_type = "Integration"
bypass_mode = "always"
}

rules {
# Prevent force push
non_fast_forward = true
# Block branch deletion
deletion = true

# Require pull request reviews before merging
pull_request {
}
}
}

0 comments on commit 39e3361

Please sign in to comment.