-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathquarkus-jgit.tf
68 lines (60 loc) · 1.87 KB
/
quarkus-jgit.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Create repository
resource "github_repository" "quarkus_jgit" {
name = "quarkus-jgit"
description = "JGit is a lightweight, pure Java library implementing the Git version control system"
homepage_url = "https://docs.quarkiverse.io/quarkus-jgit/dev/"
allow_update_branch = true
archive_on_destroy = true
delete_branch_on_merge = true
has_issues = true
vulnerability_alerts = true
topics = ["quarkus-extension", "jgit", "git", "gitea"]
}
# Create team
resource "github_team" "quarkus_jgit" {
name = "quarkiverse-jgit"
description = "Quarkiverse team for the JGit extension"
create_default_maintainer = false
privacy = "closed"
parent_team_id = data.github_team.quarkiverse_members.id
}
# Add team to repository
resource "github_team_repository" "quarkus_jgit" {
team_id = github_team.quarkus_jgit.id
repository = github_repository.quarkus_jgit.name
permission = "maintain"
}
# Add users to the team
resource "github_team_membership" "quarkus_jgit" {
for_each = { for tm in ["gastaldi"] : tm => tm }
team_id = github_team.quarkus_jgit.id
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 {
}
}
}