[BUG]: `plaintext_value` → `value` rename emits spurious update diff on every existing *OrganizationSecret

Open Beginner friendly
#3,372 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go, terraform

Research direction

Start at the schemas for github_actions_organization_secret and github_dependabot_organization_secret, focusing on the deprecated plaintext_value and encrypted_value entries. Compare the etag diff-suppression pattern from #2840 and reproduce the rename with terraform plan or pulumi preview. Done means renaming the arguments no longer shows a diff or triggers an unnecessary secret update when the value is unchanged.

Written by the indexing model from the issue text.

Description

Needs Discussion r/actions_organization_secret r/dependabot_organization_secret Status: Triage Type: Bug vNext
Module

github_actions_organization_secret, github_dependabot_organization_secret

Version

v6.12.0 (introduced by #3225)

What happened

PR #3225 renamed plaintext_valuevalue (and encrypted_valuevalue_encrypted) on the secret resources and deprecated the old property names, but did not add a DiffSuppressFunc to smooth the migration. As a result, every existing resource that was created with plaintext_value in state now shows an ~ update diff after the user renames the argument in their config — even though the secret's actual value is unchanged.

For our Pulumi wrapper (pulumi-github, bridged from this provider), we see 174 ~ update [diff: +value-plaintextValue] entries across 11 stacks, one per *OrganizationSecret resource, after switching the single source-code call site from plaintext_value=... to value=.... Each update issues a GitHub API call that writes the same plaintext secret value back. Idempotent on the GitHub side, but noisy:

  • 174 unnecessary writes to sensitive resources.
  • 174 audit-log entries that look like real secret changes.
  • State-side churn on what should be a pure property rename.
What was expected

A DiffSuppressFunc on the deprecated plaintext_value (and encrypted_value) properties so that when the new value (or value_encrypted) contains the same data, no diff is shown — mirroring the pattern already established for etag properties in #2840.

Reproduction
  1. Create a github_actions_organization_secret (or github_dependabot_organization_secret) with plaintext_value = "foo" under provider v6.11.x.
  2. Upgrade to v6.12.0+.
  3. Rename the argument to value = "foo" (no value change).
  4. Run terraform plan (or pulumi preview) — observe an update entry with a diff of the form +value-plaintextValue (or +value-plaintext_value in TF syntax).
Suggested fix

Add DiffSuppressFunc to the deprecated plaintext_value / encrypted_value schema entries so they diff-suppress against their replacements when the underlying value is unchanged. The etag handling in #2840 is a good template.

Happy to open a PR if that helps — flag if you'd accept one.

Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 23h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from integrations/terraform-provider-github

All issues in integrations/terraform-provider-github

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.