fix: import kustomize-cluster dependabot-notify file - #59
Merged
Conversation
Adopts the existing pull-request-seeded dependabot-notify workflow on kustomize-cluster into state so the reconciled apply stops attempting a protected direct write that main branch protection rejects. The live file matches the managed template byte-for-byte; only the state address is adopted. Mirrors the tfroot-twilio import precedent.
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
# github_repository_file.dependabot_notify["kustomize-cluster"] will be imported
# (imported from "kustomize-cluster:.github/workflows/dependabot-notify.yml:")
resource "github_repository_file" "dependabot_notify" {
branch = "main"
commit_message = <<-EOT
chore: root squash — collapse pre-2026 history
History squashed to a single root commit for hygiene; tree-identical to the previous main tip.
EOT
commit_sha = "3509e01896a4c8781d31598ab7807be6883ead0f"
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 = "kustomize-cluster:.github/workflows/dependabot-notify.yml:main"
overwrite_on_create = false
ref = "main"
repository = "kustomize-cluster"
repository_id = 1120687049
sha = "de2725088a33d9dc3bc14f05d3a709a093709856"
}
Plan: 1 to import, 0 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:
# github_repository_file.dependabot_notify["kustomize-cluster"] will be imported
# (imported from "kustomize-cluster:.github/workflows/dependabot-notify.yml:")
resource "github_repository_file" "dependabot_notify" {
branch = "main"
commit_message = <<-EOT
chore: root squash — collapse pre-2026 history
History squashed to a single root commit for hygiene; tree-identical to the previous main tip.
EOT
commit_sha = "3509e01896a4c8781d31598ab7807be6883ead0f"
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 = "kustomize-cluster:.github/workflows/dependabot-notify.yml:main"
overwrite_on_create = false
ref = "main"
repository = "kustomize-cluster"
repository_id = 1120687049
sha = "de2725088a33d9dc3bc14f05d3a709a093709856"
}
Plan: 1 to import, 0 to add, 0 to change, 0 to destroy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Imports the existing
.github/workflows/dependabot-notify.ymlonkustomize-clusterinto thegithub_repository_file.dependabot_notifyresource, repairing the failed main apply from run 189.The apply created the new
CHART_UPDATER_GITHUB_APP_PRIVATE_KEYsecret and completed both topic reconciliations, then failed attempting a direct write of the centrally managed dependabot-notify file to kustomize-cluster's protectedmain(409 … Changes must be made through a pull request), because that resource instance was never adopted into state. The live file content matches the managed template byte-for-byte, so only the state address is adopted. Mirrors the tfroot-twilio import precedent.Type of change
Validation
opentofu / testandopentofu / planExpected plan:
1 to import, 0 to add, 0 to change, 0 to destroy.Impact and rollout
After merge, the environment-gated apply records the import and returns the main pipeline to green; the standing per-apply 409 disappears. No repository, protection, secret, or file-content change results from this import itself.
Safety and secrets
Agent disclosure: change, branch, and this pull request were prepared by the makeitwork OpenCode agent at the owner's direction, mirroring the documented tfroot-twilio import precedent.