Skip to content

chore(github/repository): manage vulnerability alerts with their own resource - #1100

Merged
panicboat merged 2 commits into
mainfrom
chore/github-repository-vulnerability-alerts
Oct 23, 2026
Merged

panicboat merged 2 commits into
mainfrom
chore/github-repository-vulnerability-alerts

Conversation

@panicboat

@panicboat panicboat commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Why

github/repository の plan のたびに、github_repository の vulnerability_alerts について "Argument is deprecated" の警告が出ていた。provider v6.13.0 の説明は "Use the github_repository_vulnerability_alerts resource instead. This field will be removed in a future version." で、将来この引数は消える。

What

  • github_repository から vulnerability_alerts = true を外し、リポジトリごとに github_repository_vulnerability_alerts を置いた(enabled の既定は true)
  • for_each = github_repository.repository にすると、deprecated な属性(default_branch など)を経由したという警告が出るので、隣の github_workflow_repository_permissions と同じく var.repositories で回して名前だけを参照する
  • github_repository の vulnerability_alerts は Optional + Computed なので、外しても github_repository には差分が出ない
  • 新しい resource の create は、GitHub の API でアラートを有効にするだけ(EnableVulnerabilityAlerts)。今すでに有効なので、実際の設定は変わらない。import はしない
  • modules だけの変更ではラベルが付かず、merge しても apply は走らない。chore(github/repository): remove the panicboat-actions repository #1098(master/ を変える)より先に merge すれば、chore(github/repository): remove the panicboat-actions repository #1098 の apply で一緒に反映される

Verification

  • VERIFIED: tofu fmt -check github/repository/modules → exit 0
  • VERIFIED: この PR の plan(deploy:repository を手で付けて実行)→ "Plan: 6 to add, 0 to change, 0 to destroy."、create は github_repository_vulnerability_alerts の 6 つだけ、警告 0 件

🤖 Generated with Claude Code

https://claude.ai/code/session_01ExEZK1E7L1oW9CCyLm5fqD

@coderabbitai

coderabbitai Bot commented Oct 23, 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: eae49839-0266-4ecb-8d8e-258ccabcf886
  • 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 panicboat added the deploy:repository Auto-generated deployment label label Oct 23, 2026
@panicboat-github-workflow-bot

panicboat-github-workflow-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Plan Result (repository/master)

CI link

Plan: 6 to add, 0 to change, 0 to destroy.
  • Create
    • github_repository_vulnerability_alerts.repository["ansible"]
    • github_repository_vulnerability_alerts.repository["deploy-actions"]
    • github_repository_vulnerability_alerts.repository["dotfiles"]
    • github_repository_vulnerability_alerts.repository["monorepo"]
    • github_repository_vulnerability_alerts.repository["panicboat-actions"]
    • github_repository_vulnerability_alerts.repository["platform"]
Change Result (Click me)
  # github_repository_vulnerability_alerts.repository["ansible"] will be created
  + resource "github_repository_vulnerability_alerts" "repository" {
      + enabled       = true
      + id            = (known after apply)
      + repository    = "ansible"
      + repository_id = (known after apply)
    }

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

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

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

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

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

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

…erability alerts

Claude-Session: https://claude.ai/code/session_01ExEZK1E7L1oW9CCyLm5fqD
Signed-off-by: panicboat <panicboat@gmail.com>
@panicboat-github-workflow-bot panicboat-github-workflow-bot Bot removed the deploy:repository Auto-generated deployment label label Oct 23, 2026
@panicboat panicboat added the deploy:repository Auto-generated deployment label label Oct 23, 2026
@panicboat
panicboat marked this pull request as ready for review October 23, 2026 14:11
@panicboat
panicboat merged commit 0781f1a into main Oct 23, 2026
14 checks passed
@panicboat
panicboat deleted the chore/github-repository-vulnerability-alerts branch October 23, 2026 14:12
@panicboat-github-workflow-bot

Copy link
Copy Markdown
Contributor

✅ Apply Succeeded (repository/master)

CI link

Apply complete! Resources: 6 added, 0 changed, 0 destroyed.
Details (Click me)
Oct 23 14:12:39.548 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 hashicorp/aws versions matching "~> 6.68"...
- Finding integrations/github versions matching "~> 6.13"...
- 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["panicboat-actions"]: Refreshing state... [id=panicboat-actions]
github_repository.repository["ansible"]: Refreshing state... [id=ansible]
github_repository.repository["deploy-actions"]: Refreshing state... [id=deploy-actions]
github_repository.repository["monorepo"]: Refreshing state... [id=monorepo]
github_repository.repository["platform"]: Refreshing state... [id=platform]
github_repository.repository["dotfiles"]: Refreshing state... [id=dotfiles]
github_workflow_repository_permissions.repository["monorepo"]: Refreshing state... [id=monorepo]
github_workflow_repository_permissions.repository["platform"]: Refreshing state... [id=platform]

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_vulnerability_alerts.repository["ansible"] will be created
  + resource "github_repository_vulnerability_alerts" "repository" {
      + enabled       = true
      + id            = (known after apply)
      + repository    = "ansible"
      + repository_id = (known after apply)
    }

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

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

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

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

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

Plan: 6 to add, 0 to change, 0 to destroy.
github_repository_vulnerability_alerts.repository["platform"]: Creating...
github_repository_vulnerability_alerts.repository["monorepo"]: Creating...
github_repository_vulnerability_alerts.repository["dotfiles"]: Creating...
github_repository_vulnerability_alerts.repository["ansible"]: Creating...
github_repository_vulnerability_alerts.repository["panicboat-actions"]: Creating...
github_repository_vulnerability_alerts.repository["deploy-actions"]: Creating...
github_repository_vulnerability_alerts.repository["dotfiles"]: Creation complete after 3s [id=880093624]
github_repository_vulnerability_alerts.repository["platform"]: Creation complete after 4s [id=994278495]
github_repository_vulnerability_alerts.repository["monorepo"]: Creation complete after 6s [id=807388271]
github_repository_vulnerability_alerts.repository["ansible"]: Creation complete after 7s [id=880089351]
github_repository_vulnerability_alerts.repository["panicboat-actions"]: Creation complete after 8s [id=1221231096]
github_repository_vulnerability_alerts.repository["deploy-actions"]: Creation complete after 10s [id=1014666976]

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

Outputs:

repository_full_names = {
  "ansible" = "panicboat/ansible"
  "deploy-actions" = "panicboat/deploy-actions"
  "dotfiles" = "panicboat/dotfiles"
  "monorepo" = "panicboat/monorepo"
  "panicboat-actions" = "panicboat/panicboat-actions"
  "platform" = "panicboat/platform"
}
repository_html_urls = {
  "ansible" = "https://github.com/panicboat/ansible"
  "deploy-actions" = "https://github.com/panicboat/deploy-actions"
  "dotfiles" = "https://github.com/panicboat/dotfiles"
  "monorepo" = "https://github.com/panicboat/monorepo"
  "panicboat-actions" = "https://github.com/panicboat/panicboat-actions"
  "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"
  "dotfiles" = "https://github.com/panicboat/dotfiles.git"
  "monorepo" = "https://github.com/panicboat/monorepo.git"
  "panicboat-actions" = "https://github.com/panicboat/panicboat-actions.git"
  "platform" = "https://github.com/panicboat/platform.git"
}
repository_ids = {
  "ansible" = 880089351
  "deploy-actions" = 1014666976
  "dotfiles" = 880093624
  "monorepo" = 807388271
  "panicboat-actions" = 1221231096
  "platform" = 994278495
}
repository_node_ids = {
  "ansible" = "R_kgDONHUZBw"
  "deploy-actions" = "R_kgDOPHqW4A"
  "dotfiles" = "R_kgDONHUpuA"
  "monorepo" = "R_kgDOMB_Ebw"
  "panicboat-actions" = "R_kgDOSMqB-A"
  "platform" = "R_kgDOO0N8Xw"
}
repository_ssh_clone_urls = {
  "ansible" = "git@github.com:panicboat/ansible.git"
  "deploy-actions" = "git@github.com:panicboat/deploy-actions.git"
  "dotfiles" = "git@github.com:panicboat/dotfiles.git"
  "monorepo" = "git@github.com:panicboat/monorepo.git"
  "panicboat-actions" = "git@github.com:panicboat/panicboat-actions.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