Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/settings.yml: remove, terraform: add infra repo and ruleset #1695

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 0 additions & 156 deletions .github/settings.yml

This file was deleted.

75 changes: 75 additions & 0 deletions terraform/github-repo-infra.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
resource "github_repository" "infra" {
name = "infra"
description = "nix-community infrastructure [maintainer=@zowoq]"
homepage_url = "https://nix-community.org"

topics = [
"nix-community-buildbot",
"nix-darwin",
"nixos",
"terraform",
]

allow_auto_merge = true
allow_merge_commit = false
allow_rebase_merge = true
allow_squash_merge = false
delete_branch_on_merge = true
has_discussions = true
has_issues = true
vulnerability_alerts = true


pages {
build_type = "workflow"
cname = "nix-community.org"

source {
branch = "master"
path = "/"
}
}
}

resource "github_repository_ruleset" "infra" {
name = "default branch"
repository = github_repository.infra.name
target = "branch"
enforcement = "active"

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

rules {
deletion = true
non_fast_forward = true

merge_queue {
check_response_timeout_minutes = 60
grouping_strategy = "ALLGREEN"
max_entries_to_build = 1
max_entries_to_merge = 1
merge_method = "REBASE"
min_entries_to_merge = 1
min_entries_to_merge_wait_minutes = 5
}

pull_request {
dismiss_stale_reviews_on_push = false
require_code_owner_review = false
require_last_push_approval = false
required_approving_review_count = 0
required_review_thread_resolution = false
}

required_status_checks {
required_check {
context = "buildbot/nix-build"
}
}
}
}
3 changes: 1 addition & 2 deletions terraform/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
packages = [
(terraform.withPlugins (p: [
p.cloudflare
p.external
p.github
p.hydra
p.null
p.sops
p.tfe
]))
Expand Down
8 changes: 8 additions & 0 deletions terraform/terraform_providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ terraform {
cloudflare = {
source = "cloudflare/cloudflare"
}
github = {
source = "integrations/github"
}
hydra = {
source = "DeterminateSystems/hydra"
}
Expand All @@ -23,6 +26,11 @@ provider "cloudflare" {
api_token = data.sops_file.nix-community.data["CLOUDFLARE_API_TOKEN"]
}

provider "github" {
# admin provides their own token
owner = "nix-community"
}

provider "hydra" {
host = "https://hydra.nix-community.org"
password = data.sops_file.nix-community.data["HYDRA_PASSWORD"]
Expand Down