Skip to content
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
15 changes: 0 additions & 15 deletions github/as_found.tf

This file was deleted.

14 changes: 7 additions & 7 deletions github/repos.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repository settings, default-branch rulesets and GitHub Pages for every
# repository under `managed` in repos.jsonnet (compiled by //:repos to
# ../repos.json), with temporary overrides in as_found.tf.
# ../repos.json).

locals {
repos = jsondecode(file("${path.module}/../repos.json")).managed
Expand All @@ -26,12 +26,12 @@ resource "github_repository" "this" {
has_wiki = false
has_discussions = false

allow_merge_commit = try(local.as_found[each.key].allow_merge_commit, false)
allow_merge_commit = false
allow_squash_merge = true
allow_rebase_merge = true
allow_auto_merge = try(local.as_found[each.key].allow_auto_merge, true)
allow_auto_merge = true
allow_update_branch = false
delete_branch_on_merge = try(local.as_found[each.key].delete_branch_on_merge, true)
delete_branch_on_merge = true
web_commit_signoff_required = false
squash_merge_commit_title = "COMMIT_OR_PR_TITLE"
squash_merge_commit_message = "COMMIT_MESSAGES"
Expand All @@ -58,7 +58,7 @@ resource "github_repository" "this" {
# are required unless direct_pushes is set; required_checks, when non-empty,
# must come from GitHub Actions.
resource "github_repository_ruleset" "default_branch" {
for_each = { for name, repo in local.repos : name => repo if try(local.as_found[name].ruleset, true) }
for_each = local.repos

name = "main"
repository = github_repository.this[each.key].name
Expand Down Expand Up @@ -120,7 +120,7 @@ resource "github_repository_pages" "this" {
# Turns on Dependabot alerts: GitHub warns when a dependency has a known
# vulnerability.
resource "github_repository_vulnerability_alerts" "this" {
for_each = { for name, repo in local.repos : name => repo if try(local.as_found[name].dependabot_alerts, true) }
for_each = local.repos

repository = github_repository.this[each.key].name
enabled = true
Expand All @@ -129,7 +129,7 @@ resource "github_repository_vulnerability_alerts" "this" {
# Opens Dependabot pull requests that update vulnerable dependencies to fixed
# versions. Needs alerts on, so repository comes from the alert resource.
resource "github_repository_dependabot_security_updates" "this" {
for_each = { for name, repo in local.repos : name => repo if try(local.as_found[name].dependabot_alerts, true) }
for_each = local.repos

repository = github_repository_vulnerability_alerts.this[each.key].repository
enabled = true
Expand Down