Skip to content

feat(actions): distribute chart updater app key to OpenTofu roots - #45

Merged
xnoto merged 4 commits into
mainfrom
feat/opentofu-docs-app-secret-recipients
Aug 30, 2026
Merged

feat(actions): distribute chart updater app key to OpenTofu roots#45
xnoto merged 4 commits into
mainfrom
feat/opentofu-docs-app-secret-recipients

Conversation

@xnoto

@xnoto xnoto commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extend the existing SOPS-backed chart_updater_github_app_private_key recipient list to the five OpenTofu caller roots: tfroot-aws, tfroot-cloudflare, tfroot-gcp, tfroot-github, tfroot-libvirt
  • also fixes a pre-existing main breakage: the www_access_key_id / www_secret_access_key lookups drifted from the actual SOPS key names (www_aws_access_key_id / www_aws_secret_access_key, matching the onion_aws_* naming), which failed every plan on main with Invalid index and blocked the post-feat: manage private agent knowledge repository #44 apply. The values never left secrets/secrets.yaml; only the main.tf references were wrong. No SOPS or secret-value changes.
  • no secret name (name =) changes, so existing Actions secrets are untouched

Context

This finishes the migration started in #42. The shared OpenTofu workflow's generated-docs commit path (makeitworkcloud/shared-workflows#33) now consumes CHART_UPDATER_GITHUB_APP_PRIVATE_KEY as an Actions secret, matching how charts already uses it, so each caller repository needs the secret provisioned. The chart updater GitHub App installation already covers the organization.

Per docs/chart-updater-github-app.md, adding source repositories broadens private-key distribution and requires explicit review. Once this and the companion PRs merge and apply, the AWS Secrets Manager copy becomes genuinely unreferenced; removing the github-actions-opentofu-docs role is tracked in makeitworkcloud/tfroot-aws#32 (draft).

Validation

  • PR CI plan is the validation authority; confirm it creates exactly five new github_actions_secret.secrets instances plus the already-pending github_branch_protection.relaxed_protections["agent-knowledge"] from feat: manage private agent knowledge repository #44, and modifies nothing else.
  • Reviewed the diff: no decrypted values or plaintext material included.

Rollout

Merge and let the environment-gated apply complete before merging the five caller PRs, so the Actions secret exists when callers start mapping it. Merge order: shared-workflows#33 first, then this PR, then the caller PRs.

@xnoto
xnoto requested a review from a team as a code owner August 30, 2026 16:59
@github-actions

github-actions Bot commented Aug 30, 2026

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

xnoto added 3 commits August 30, 2026 11:16
Temporary copy of secrets/secrets.yaml as of the PR #42 merge
(1f64c6d) so the AWS access key values can be manually copied into
secrets/secrets.yaml under the key names referenced by this branch.
Delete this file once the values are migrated.
The www access-key lookups drifted to www_access_key_id /
www_secret_access_key, which do not exist in secrets/secrets.yaml; the
values are stored as www_aws_access_key_id / www_aws_secret_access_key
(matching the onion_* naming). This broke every plan on main with
"Invalid index" since the drift landed.
No value migration is needed: the www AWS values still exist in
secrets/secrets.yaml under the www_aws_* key names; only the main.tf
lookups had drifted.
@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu will perform the following actions:

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-aws"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-cloudflare"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-gcp"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-github"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-libvirt"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

  # github_branch_protection.relaxed_protections["agent-knowledge"] will be created
  + resource "github_branch_protection" "relaxed_protections" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = true
      + id                              = (known after apply)
      + lock_branch                     = false
      + pattern                         = "main"
      + repository_id                   = "R_kgDOUIbYrw"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = true

      + required_pull_request_reviews {
          + require_code_owner_reviews      = false
          + require_last_push_approval      = false
          + required_approving_review_count = 0
        }

      + restrict_pushes {
          + blocks_creations = true
          + push_allowances  = [
              + "makeitworkcloud/admins",
            ]
        }
    }

Plan: 6 to add, 0 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

OpenTofu will perform the following actions:

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-aws"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-cloudflare"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-gcp"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-github"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "tfroot-libvirt"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

  # github_branch_protection.relaxed_protections["agent-knowledge"] will be created
  + resource "github_branch_protection" "relaxed_protections" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = true
      + id                              = (known after apply)
      + lock_branch                     = false
      + pattern                         = "main"
      + repository_id                   = "R_kgDOUIbYrw"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = true

      + required_pull_request_reviews {
          + require_code_owner_reviews      = false
          + require_last_push_approval      = false
          + required_approving_review_count = 0
        }

      + restrict_pushes {
          + blocks_creations = true
          + push_allowances  = [
              + "makeitworkcloud/admins",
            ]
        }
    }

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

@xnoto
xnoto merged commit a4a5aae into main Aug 30, 2026
3 checks passed
@xnoto
xnoto deleted the feat/opentofu-docs-app-secret-recipients branch August 30, 2026 17:41
xnoto added a commit to makeitworkcloud/tfroot-aws that referenced this pull request Aug 30, 2026
## Summary

- map the repository `CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions
secret into the reusable OpenTofu workflow

## Context

Completes the chart updater App key migration for this root.
makeitworkcloud/shared-workflows#33 replaces the AWS OIDC + Secrets
Manager docs-commit credential with this secret;
makeitworkcloud/tfroot-github#45 provisions the secret to this
repository.

## Merge order

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45 (apply provisions the secret)
3. This PR

CI on this PR calls the reusable workflow from `@main` and cannot pass
until shared-workflows#33 merges; re-run checks after that lands.

## Validation

- Reviewed the diff: one secret mapping added; no credentials or
decrypted values included.
- GitHub Actions checks are the validation authority after the
dependency merges.
xnoto added a commit to makeitworkcloud/tfroot-cloudflare that referenced this pull request Aug 30, 2026
## Summary

- map the repository `CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions
secret into the reusable OpenTofu workflow

## Context

Completes the chart updater App key migration for this root.
makeitworkcloud/shared-workflows#33 replaces the AWS OIDC + Secrets
Manager docs-commit credential with this secret;
makeitworkcloud/tfroot-github#45 provisions the secret to this
repository.

## Merge order

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45 (apply provisions the secret)
3. This PR

CI on this PR calls the reusable workflow from `@main` and cannot pass
until shared-workflows#33 merges; re-run checks after that lands.

## Validation

- Reviewed the diff: one secret mapping added; no credentials or
decrypted values included.
- GitHub Actions checks are the validation authority after the
dependency merges.
xnoto added a commit to makeitworkcloud/tfroot-gcp that referenced this pull request Aug 30, 2026
## Summary

- map the repository `CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions
secret into the reusable OpenTofu workflow

## Context

Completes the chart updater App key migration for this root.
makeitworkcloud/shared-workflows#33 replaces the AWS OIDC + Secrets
Manager docs-commit credential with this secret;
makeitworkcloud/tfroot-github#45 provisions the secret to this
repository.

## Merge order

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45 (apply provisions the secret)
3. This PR

CI on this PR calls the reusable workflow from `@main` and cannot pass
until shared-workflows#33 merges; re-run checks after that lands.

## Validation

- Reviewed the diff: one secret mapping added; no credentials or
decrypted values included.
- GitHub Actions checks are the validation authority after the
dependency merges.
xnoto added a commit that referenced this pull request Aug 30, 2026
## Summary

- map the repository `CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions
secret into the reusable OpenTofu workflow

## Context

Completes the chart updater App key migration for this root.
makeitworkcloud/shared-workflows#33 replaces the AWS OIDC + Secrets
Manager docs-commit credential with this secret;
#45 provisions the secret to this
repository.

## Merge order

1. makeitworkcloud/shared-workflows#33
2. #45 (apply provisions the secret)
3. This PR

CI on this PR calls the reusable workflow from `@main` and cannot pass
until shared-workflows#33 merges; re-run checks after that lands.

## Validation

- Reviewed the diff: one secret mapping added; no credentials or
decrypted values included.
- GitHub Actions checks are the validation authority after the
dependency merges.
xnoto added a commit to makeitworkcloud/tfroot-libvirt that referenced this pull request Aug 30, 2026
## Summary

- map the repository `CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions
secret into the reusable OpenTofu workflow alongside the existing SSH
key mappings

## Context

Completes the chart updater App key migration for this root.
makeitworkcloud/shared-workflows#33 replaces the AWS OIDC + Secrets
Manager docs-commit credential with this secret;
makeitworkcloud/tfroot-github#45 provisions the secret to this
repository.

## Merge order

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45 (apply provisions the secret)
3. This PR

CI on this PR calls the reusable workflow from `@main` and cannot pass
until shared-workflows#33 merges; re-run checks after that lands.

## Validation

- Reviewed the diff: one secret mapping added; no credentials or
decrypted values included.
- GitHub Actions checks are the validation authority after the
dependency merges.
xnoto added a commit to makeitworkcloud/tfroot-aws that referenced this pull request Aug 30, 2026
## Summary

- remove the `github-actions-opentofu-docs` IAM role and its inline
Secrets Manager read policy

## Context

The shared OpenTofu workflow's generated-docs commit path no longer uses
AWS: makeitworkcloud/shared-workflows#33 sources the chart updater
GitHub App key from the caller-mapped
`CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions secret, provisioned by
makeitworkcloud/tfroot-github#45. After those land, nothing references
this role or the legacy Secrets Manager copy, matching
`tfroot-github/docs/chart-updater-github-app.md`.

This mirrors #30, which removed the charts-facing role. The manually
created Secrets Manager secret
(`xnoto-s-chart-updater-github-app-private-key-*`) is intentionally not
deleted here; per the runbook its deletion is a separate approved
cleanup after the agreed rollback window.

## Rollout dependency

Draft until all of the following have merged and applied:

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45
3. Caller PRs: #31, tfroot-cloudflare#37,
tfroot-gcp#5, tfroot-github#46, tfroot-libvirt#26

Destroying this role before then breaks generated-docs commits on
same-repository PRs.

## Validation

- GitHub Actions OpenTofu test and plan are required before merge; the
plan must show only the role and policy destruction.
- Reviewed the diff: file deletion only; no credentials or decrypted
values included.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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