forked from workloads/github-organization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiles.tf
37 lines (32 loc) · 1.54 KB
/
files.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
locals {
# see https://developer.hashicorp.com/terraform/language/functions/templatefile
tooling_make_configs_github = templatefile("templates/scripts/config_github.tftpl.mk", {
github_org = var.github_owner
# flatten GitHub Repository names to allow for consumption in downstream tooling (Make)
github_repositories = join(" ", [
for repo in var.repositories : repo.name
])
github_terraform_repositories = join(" ", [
for repo in var.terraform_repositories : repo.name
])
scorecard_checks = var.scorecard_checks
})
}
# automatically update `workloads/assets/.gitattributes`
# see https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file
resource "github_repository_file" "tooling_gitattributes" {
repository = module.repositories["tooling"].github_repository.id
branch = "main"
file = ".gitattributes"
content = file("./templates/gitattributes/tooling.gitattributes")
overwrite_on_create = true
}
# automatically update `workloads/assets/scripts/_config.sh` when new Terraform-based GitHub repositories are added
# see https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file
resource "github_repository_file" "tooling_make_configs_github" {
repository = module.repositories["tooling"].github_repository.id
branch = "main"
file = "make/configs/github.mk"
content = local.tooling_make_configs_github
overwrite_on_create = true
}