Skip to content

chore(github/repository): open the monorepo production environment to release tags - #1118

Merged
panicboat merged 1 commit into
mainfrom
chore/open-monorepo-production-environment
Oct 24, 2026
Merged

panicboat merged 1 commit into
mainfrom
chore/open-monorepo-production-environment

Conversation

@panicboat

Copy link
Copy Markdown
Owner

Why

monorepo に、release 公開で production を apply する Release - Deploy workflow を入れる(panicboat/monorepo#1746)。
その apply job は GitHub environment production を宣言して、release tag <service>-vX.Y.Z の ref で動く。
monorepo の production は #1110 でどの ref からも deploy できないようにしていたので、platform と同じく release tag からだけ使えるようにする。

What

  • github/repository/master/monorepo.hcl の production に tag pattern *-v* を設定する。
    • can_admins_bypass = false と custom_branch_policies = true は module のまま変わらない。
  • README の environment の項目を、platform と monorepo の両方が *-v* だけを受け付ける内容に直す。

影響

  • monorepo の production は workflow-config.yaml で除外中なので、merge しても environment: production を使う job はまだ動かない。
  • tag 以外の ref(branch)から environment: production を宣言した job は、引き続き GitHub に止められる。

Test plan

  • tofu test(github/repository/modules)が 3 passed
  • tofu fmt -check -recursive github/repository が成功
  • PR 上の github/repository の plan に、monorepo の production の deployment policy *-v* の追加だけが出る
  • merge 後、gh api repos/panicboat/monorepo/environments/production/deployment-branch-policies が tag *-v* を 1 件返す

Relations

🤖 Generated with Claude Code

https://claude.ai/code/session_01BZfNTtmPjmrDmh1MAMtiFS

… release tags

Signed-off-by: panicboat <panicboat@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8fe34dea-5771-4706-a2f6-e9cdf0fc72e2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@panicboat-github-workflow-bot

Copy link
Copy Markdown
Contributor

Plan Result (repository/master)

CI link

Plan: 3 to add, 0 to change, 0 to destroy.
  • Create
    • github_repository.repository["dot-github"]
    • github_repository_environment_deployment_policy.repository["monorepo/production/-v"]
    • github_repository_vulnerability_alerts.repository["dot-github"]
Change Result (Click me)
  # github_repository.repository["dot-github"] will be created
  + resource "github_repository" "repository" {
      + allow_auto_merge                        = true
      + allow_forking                           = (known after apply)
      + allow_merge_commit                      = false
      + allow_rebase_merge                      = false
      + allow_squash_merge                      = true
      + allow_update_branch                     = true
      + archived                                = false
      + default_branch                          = (known after apply)
      + delete_branch_on_merge                  = true
      + description                             = "Default community health files and shared GitHub workflows for panicboat repositories."
      + etag                                    = (known after apply)
      + fork                                    = (known after apply)
      + full_name                               = (known after apply)
      + git_clone_url                           = (known after apply)
      + has_issues                              = true
      + has_projects                            = true
      + has_wiki                                = false
      + html_url                                = (known after apply)
      + http_clone_url                          = (known after apply)
      + id                                      = (known after apply)
      + ignore_vulnerability_alerts_during_read = false
      + merge_commit_message                    = "PR_TITLE"
      + merge_commit_title                      = "MERGE_MESSAGE"
      + name                                    = ".github"
      + node_id                                 = (known after apply)
      + primary_language                        = (known after apply)
      + private                                 = (known after apply)
      + repo_id                                 = (known after apply)
      + source_owner                            = (known after apply)
      + source_repo                             = (known after apply)
      + squash_merge_commit_message             = "BLANK"
      + squash_merge_commit_title               = "PR_TITLE"
      + ssh_clone_url                           = (known after apply)
      + svn_url                                 = (known after apply)
      + topics                                  = (known after apply)
      + visibility                              = "public"
      + vulnerability_alerts                    = (known after apply)
      + web_commit_signoff_required             = (known after apply)

      + security_and_analysis (known after apply)
    }

  # github_repository_environment_deployment_policy.repository["monorepo/production/*-v*"] will be created
  + resource "github_repository_environment_deployment_policy" "repository" {
      + environment   = "production"
      + id            = (known after apply)
      + policy_id     = (known after apply)
      + repository    = "monorepo"
      + repository_id = (known after apply)
      + tag_pattern   = "*-v*"
    }

  # github_repository_vulnerability_alerts.repository["dot-github"] will be created
  + resource "github_repository_vulnerability_alerts" "repository" {
      + enabled       = true
      + id            = (known after apply)
      + repository    = ".github"
      + repository_id = (known after apply)
    }

Plan: 3 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  ~ repository_full_names      = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }
  ~ repository_html_urls       = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }
  ~ repository_http_clone_urls = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }
  ~ repository_ids             = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }
  ~ repository_node_ids        = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }
  ~ repository_ssh_clone_urls  = {
      + dot-github     = (known after apply)
        # (5 unchanged attributes hidden)
    }

@panicboat
panicboat marked this pull request as ready for review October 24, 2026 17:19
@panicboat
panicboat merged commit a5feada into main Oct 24, 2026
18 checks passed
@panicboat
panicboat deleted the chore/open-monorepo-production-environment branch October 24, 2026 17:20
@panicboat-github-workflow-bot

Copy link
Copy Markdown
Contributor

✅ Apply Succeeded (repository/master)

CI link

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Details (Click me)
Oct 24 17:20:33.994 INF download and unarchive the package program=aqua version=2.64.0 env=linux/amd64 exe_name=terragrunt package_name=gruntwork-io/terragrunt package_version=v1.0.2 registry=standard

Initializing the backend...

Successfully configured the backend "s3"! OpenTofu will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding integrations/github versions matching "~> 6.13"...
- Finding hashicorp/aws versions matching "~> 6.68"...
- Installing hashicorp/aws v6.70.0 to the shared cache directory...
- Installing integrations/github v6.13.0 to the shared cache directory...
- Installed integrations/github v6.13.0 (signed, key ID 38027F80D7FD5FB2)
- Using integrations/github v6.13.0 from the shared cache directory
- Installed hashicorp/aws v6.70.0 (signed, key ID 0C0AF313E5FD9F80)
- Using hashicorp/aws v6.70.0 from the shared cache directory

Providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://opentofu.org/docs/cli/plugins/signing/

OpenTofu has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that OpenTofu can guarantee to make the same selections by default when
you run "tofu init" in the future.

OpenTofu has been successfully initialized!

You may now begin working with OpenTofu. Try running "tofu plan" to see
any changes that are required for your infrastructure. All OpenTofu commands
should now work.

If you ever set or change modules or backend configuration for OpenTofu,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
github_repository.repository["deploy-actions"]: Refreshing state... [id=deploy-actions]
github_repository.repository["dotfiles"]: Refreshing state... [id=dotfiles]
github_repository.repository["platform"]: Refreshing state... [id=platform]
github_repository.repository["dot-github"]: Refreshing state... [id=.github]
github_repository.repository["ansible"]: Refreshing state... [id=ansible]
github_repository.repository["monorepo"]: Refreshing state... [id=monorepo]
github_workflow_repository_permissions.repository["platform"]: Refreshing state... [id=platform]
github_workflow_repository_permissions.repository["monorepo"]: Refreshing state... [id=monorepo]
github_repository_vulnerability_alerts.repository["platform"]: Refreshing state... [id=994278495]
github_repository_vulnerability_alerts.repository["dot-github"]: Refreshing state... [id=1432417684]
github_repository_vulnerability_alerts.repository["ansible"]: Refreshing state... [id=880089351]
github_repository_vulnerability_alerts.repository["monorepo"]: Refreshing state... [id=807388271]
github_repository_vulnerability_alerts.repository["dotfiles"]: Refreshing state... [id=880093624]
github_repository_environment.repository["monorepo/production"]: Refreshing state... [id=monorepo:production]
github_repository_vulnerability_alerts.repository["deploy-actions"]: Refreshing state... [id=1014666976]
github_repository_environment.repository["platform/production"]: Refreshing state... [id=platform:production]
github_repository_environment_deployment_policy.repository["platform/production/*-v*"]: Refreshing state... [id=platform:production:64198899]

OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

OpenTofu will perform the following actions:

  # github_repository_environment_deployment_policy.repository["monorepo/production/*-v*"] will be created
  + resource "github_repository_environment_deployment_policy" "repository" {
      + environment   = "production"
      + id            = (known after apply)
      + policy_id     = (known after apply)
      + repository    = "monorepo"
      + repository_id = (known after apply)
      + tag_pattern   = "*-v*"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
github_repository_environment_deployment_policy.repository["monorepo/production/*-v*"]: Creating...
github_repository_environment_deployment_policy.repository["monorepo/production/*-v*"]: Creation complete after 2s [id=monorepo:production:64221961]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

repository_full_names = {
  "ansible" = "panicboat/ansible"
  "deploy-actions" = "panicboat/deploy-actions"
  "dot-github" = "panicboat/.github"
  "dotfiles" = "panicboat/dotfiles"
  "monorepo" = "panicboat/monorepo"
  "platform" = "panicboat/platform"
}
repository_html_urls = {
  "ansible" = "https://github.com/panicboat/ansible"
  "deploy-actions" = "https://github.com/panicboat/deploy-actions"
  "dot-github" = "https://github.com/panicboat/.github"
  "dotfiles" = "https://github.com/panicboat/dotfiles"
  "monorepo" = "https://github.com/panicboat/monorepo"
  "platform" = "https://github.com/panicboat/platform"
}
repository_http_clone_urls = {
  "ansible" = "https://github.com/panicboat/ansible.git"
  "deploy-actions" = "https://github.com/panicboat/deploy-actions.git"
  "dot-github" = "https://github.com/panicboat/.github.git"
  "dotfiles" = "https://github.com/panicboat/dotfiles.git"
  "monorepo" = "https://github.com/panicboat/monorepo.git"
  "platform" = "https://github.com/panicboat/platform.git"
}
repository_ids = {
  "ansible" = 880089351
  "deploy-actions" = 1014666976
  "dot-github" = 1432417684
  "dotfiles" = 880093624
  "monorepo" = 807388271
  "platform" = 994278495
}
repository_node_ids = {
  "ansible" = "R_kgDONHUZBw"
  "deploy-actions" = "R_kgDOPHqW4A"
  "dot-github" = "R_kgDOVWD1lA"
  "dotfiles" = "R_kgDONHUpuA"
  "monorepo" = "R_kgDOMB_Ebw"
  "platform" = "R_kgDOO0N8Xw"
}
repository_ssh_clone_urls = {
  "ansible" = "git@github.com:panicboat/ansible.git"
  "deploy-actions" = "git@github.com:panicboat/deploy-actions.git"
  "dot-github" = "git@github.com:panicboat/.github.git"
  "dotfiles" = "git@github.com:panicboat/dotfiles.git"
  "monorepo" = "git@github.com:panicboat/monorepo.git"
  "platform" = "git@github.com:panicboat/platform.git"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy:repository Auto-generated deployment label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant