Skip to content

feat: initialize managed repositories - #41

Merged
xnoto merged 1 commit into
mainfrom
feat/initialize-managed-repositories
Aug 28, 2026
Merged

feat: initialize managed repositories#41
xnoto merged 1 commit into
mainfrom
feat/initialize-managed-repositories

Conversation

@xnoto

@xnoto xnoto commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable auto_init for every centrally managed repository so a new repository receives an initial commit and main branch at creation time.

Impact

  • New repositories can immediately receive branch protection and be bootstrapped through a normal scoped branch and pull request.
  • Existing repository content, secrets, SOPS data, workflows, and branch-protection settings are unchanged.

Validation

  • Reviewed the secret-free diff: one change in gh-repositories.tf.
  • Verified against the GitHub provider documentation that auto_init creates an initial commit.
  • PR CI plan/checks are the validation authority.

@xnoto
xnoto requested a review from a team as a code owner August 28, 2026 04:09
@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu CI passed

View the workflow run.

Validation output (redacted, last 12000 characters)

Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu will perform the following actions:

  # github_repository.repositories[".github"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = ".github"
        name                                    = ".github"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-project-libvirt"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-project-libvirt"
        name                                    = "ansible-project-libvirt"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-role-crc"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-role-crc"
        name                                    = "ansible-role-crc"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-site-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-site-cluster"
        name                                    = "ansible-site-cluster"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["cflan"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "cflan"
        name                                    = "cflan"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["images"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "images"
        name                                    = "images"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["kustomize-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "kustomize-cluster"
        name                                    = "kustomize-cluster"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["shared-workflows"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "shared-workflows"
        name                                    = "shared-workflows"
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["terraform-libvirt-domain"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "terraform-libvirt-domain"
        name                                    = "terraform-libvirt-domain"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-aws"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-aws"
        name                                    = "tfroot-aws"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-cloudflare"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-cloudflare"
        name                                    = "tfroot-cloudflare"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-gcp"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "tfroot-gcp"
        name                                    = "tfroot-gcp"
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-github"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-github"
        name                                    = "tfroot-github"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-libvirt"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-libvirt"
        name                                    = "tfroot-libvirt"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-namecheap"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "tfroot-namecheap"
        name                                    = "tfroot-namecheap"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["www"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "www"
        name                                    = "www"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository_file.dependabot["tfroot-namecheap"] will be created
  + resource "github_repository_file" "dependabot" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot configuration"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            "updates":
            - "directory": "/"
              "groups":
                "github-actions":
                  "patterns":
                  - "*"
              "package-ecosystem": "github-actions"
              "schedule":
                "interval": "daily"
            - "directory": "/"
              "groups":
                "opentofu":
                  "patterns":
                  - "*"
              "package-ecosystem": "opentofu"
              "schedule":
                "interval": "daily"
            "version": 2
        EOT
      + file                         = ".github/dependabot.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "tfroot-namecheap"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_repository_file.dependabot_notify["tfroot-namecheap"] will be created
  + resource "github_repository_file" "dependabot_notify" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot notification workflow"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            ---
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            name: dependabot-notify
            
            on:
              pull_request:
                types: [opened, reopened]
            
            permissions: {}
            
            jobs:
              notify:
                if: github.actor == 'dependabot[bot]'
                uses: makeitworkcloud/shared-workflows/.github/workflows/_dependabot-notify.yml@main
[REDACTED: potentially sensitive plan output]
        EOT
      + file                         = ".github/workflows/dependabot-notify.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "tfroot-namecheap"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

Plan: 2 to add, 16 to change, 0 to destroy.
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place (current -> planned)

OpenTofu will perform the following actions:

  # github_repository.repositories[".github"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = ".github"
        name                                    = ".github"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-project-libvirt"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-project-libvirt"
        name                                    = "ansible-project-libvirt"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-role-crc"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-role-crc"
        name                                    = "ansible-role-crc"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["ansible-site-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "ansible-site-cluster"
        name                                    = "ansible-site-cluster"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["cflan"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "cflan"
        name                                    = "cflan"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["images"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "images"
        name                                    = "images"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["kustomize-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "kustomize-cluster"
        name                                    = "kustomize-cluster"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["shared-workflows"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "shared-workflows"
        name                                    = "shared-workflows"
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["terraform-libvirt-domain"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "terraform-libvirt-domain"
        name                                    = "terraform-libvirt-domain"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-aws"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-aws"
        name                                    = "tfroot-aws"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-cloudflare"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-cloudflare"
        name                                    = "tfroot-cloudflare"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-gcp"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "tfroot-gcp"
        name                                    = "tfroot-gcp"
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-github"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-github"
        name                                    = "tfroot-github"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-libvirt"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      + auto_init                               = true
        id                                      = "tfroot-libvirt"
        name                                    = "tfroot-libvirt"
        # (37 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["tfroot-namecheap"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "tfroot-namecheap"
        name                                    = "tfroot-namecheap"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["www"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ auto_init                               = false -> true
        id                                      = "www"
        name                                    = "www"
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository_file.dependabot["tfroot-namecheap"] will be created
  + resource "github_repository_file" "dependabot" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot configuration"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            "updates":
            - "directory": "/"
              "groups":
                "github-actions":
                  "patterns":
                  - "*"
              "package-ecosystem": "github-actions"
              "schedule":
                "interval": "daily"
            - "directory": "/"
              "groups":
                "opentofu":
                  "patterns":
                  - "*"
              "package-ecosystem": "opentofu"
              "schedule":
                "interval": "daily"
            "version": 2
        EOT
      + file                         = ".github/dependabot.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "tfroot-namecheap"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_repository_file.dependabot_notify["tfroot-namecheap"] will be created
  + resource "github_repository_file" "dependabot_notify" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot notification workflow"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            ---
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            name: dependabot-notify
            
            on:
              pull_request:
                types: [opened, reopened]
            
            permissions: {}
            
            jobs:
              notify:
                if: github.actor == 'dependabot[bot]'
                uses: makeitworkcloud/shared-workflows/.github/workflows/_dependabot-notify.yml@main
[REDACTED: potentially sensitive plan output]
        EOT
      + file                         = ".github/workflows/dependabot-notify.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "tfroot-namecheap"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

Plan: 2 to add, 16 to change, 0 to destroy.

@xnoto
xnoto merged commit 05ba1df into main Aug 28, 2026
4 checks passed
@xnoto
xnoto deleted the feat/initialize-managed-repositories branch August 28, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant