From 8bb919e9396cd68c43c730b8d96931d7bf067318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Bru=C5=BEina?= Date: Sun, 5 Apr 2026 23:07:39 +0200 Subject: [PATCH 1/3] feat: add repository is_template property --- README.md | 4 ++++ terraform/main.tf | 3 +++ test.yaml | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 09bd44d..e513485 100644 --- a/README.md +++ b/README.md @@ -107,10 +107,14 @@ Create the configuration file: --- repositories: - name: repo-slug + # Metadata description: "The repository description." # OPTIONAL, DEFAULT none homepage_url: https://example.com/ # OPTIONAL, DEFAULT none topics: # OPTIONAL, DEFAULT none - some-topic + - another-topic + # Properties + is_template: true # OPTIONAL, DEFAULT false ``` Set it as source of truth: diff --git a/terraform/main.tf b/terraform/main.tf index 289efde..54a482e 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -11,4 +11,7 @@ resource "github_repository" "this" { description = try(each.value.description, null) homepage_url = try(each.value.homepage_url, null) topics = try(each.value.topics, null) + + # Properties + is_template = try(each.value.is_template, null) } diff --git a/test.yaml b/test.yaml index 6184241..54b863b 100644 --- a/test.yaml +++ b/test.yaml @@ -6,3 +6,8 @@ repositories: - github-organization-profile - github-profile - github-profile-readme + - name: template + description: "Standardized repository scaffold for BruzIT projects. Pre-configured with semantic-release, license boilerplate, README structure, and initial v0.0.0 tag." + topics: + - repository-template + is_template: true From 08b821d368305c18a6ebd807ded74e4a6d22f6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Bru=C5=BEina?= Date: Sun, 5 Apr 2026 23:31:55 +0200 Subject: [PATCH 2/3] feat: add repository template --- README.md | 5 +++++ terraform/main.tf | 14 ++++++++++++++ test.yaml | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/README.md b/README.md index e513485..ee475d6 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,11 @@ repositories: - another-topic # Properties is_template: true # OPTIONAL, DEFAULT false + # Contents + template: # OPTIONAL, DEFAULT none + owner: bruzit + repository: template + include_all_branches: true # OPTIONAL, DEFAULT false ``` Set it as source of truth: diff --git a/terraform/main.tf b/terraform/main.tf index 54a482e..c14b9e4 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -14,4 +14,18 @@ resource "github_repository" "this" { # Properties is_template = try(each.value.is_template, null) + + # Contents + dynamic "template" { + for_each = ( + try(each.value.template, null) != null && + length(try(each.value.template, {})) > 0 + ) ? [each.value.template] : [] + + content { + owner = template.value.owner + repository = template.value.repository + include_all_branches = try(template.value.include_all_branches, false) + } + } } diff --git a/test.yaml b/test.yaml index 54b863b..872abff 100644 --- a/test.yaml +++ b/test.yaml @@ -11,3 +11,7 @@ repositories: topics: - repository-template is_template: true + - name: template-use + template: + owner: bruzit-test + repository: template From 7704bbb01f405a1774ccc110b68085fe0cd732df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Bru=C5=BEina?= Date: Sun, 5 Apr 2026 23:33:56 +0200 Subject: [PATCH 3/3] docs: improve repositories descriptions and topics --- README.md | 2 +- test.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee475d6..9913f60 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitHub Organization as Code -GitHub organization managed as code. +GitHub organization managed as code. Implements a GitOps workflow to transform a YAML - declarative GitHub organization definition into GitHub resources, automating configuration of repositories. ## Features diff --git a/test.yaml b/test.yaml index 872abff..f17379b 100644 --- a/test.yaml +++ b/test.yaml @@ -1,11 +1,12 @@ --- repositories: - name: .github - description: "BruzIT Test organization profile and management." + description: "BruzIT Test organization profile and repository management." topics: - - github-organization-profile - github-profile - github-profile-readme + - github-organization-profile + - github-organization-management - name: template description: "Standardized repository scaffold for BruzIT projects. Pre-configured with semantic-release, license boilerplate, README structure, and initial v0.0.0 tag." topics: