terraform-provider-github
terraform-provider-github copied to clipboard
github_actions_organization_secret always applies the value, even if it's unchanged
Terraform Version
Terraform v0.13.5
Affected Resource(s)
Please list the resources as a list, for example:
- github_actions_organization_secret
Terraform Configuration Files
resource "github_actions_organization_secret" "this" {
for_each = toset(local.secrets)
secret_name = each.value
visibility = "selected"
plaintext_value = "(placeholder)" # we'll change these values outside of Terraform
selected_repository_ids = [
for repo in data.github_repository.repos : repo.repo_id
]
lifecycle {
ignore_changes = [
plaintext_value
]
}
}
Expected Behavior
In this example, I'm giving providing a list of repositories that can access the secret. You can see I'm using (placeholder)
as the plaintext value, with the idea that I would go into Github outside of TF and add in the real value once.
When I change the list of repositories, I expect that the real value I inputted would remain the same.
Actual Behavior
However, it actually replaces the real value with the placeholder.
Steps to Reproduce
- Use the
github_actions_organization_secret
resource to create a value likeFOO
with a default value of(placeholder)
-
terraform apply
the change/creation - Go into your Github organization and edit the secret to have a value like
Hello World
- Using the above config, modify the
selected_repository_ids
and apply the change - In your Github Actions workflow, create a step like this:
- name: DEBUG! env: MY_SECRET: ${{ secrets.FOO }} run: | echo ${MY_SECRET} | sed 's/./& /g'
- Push and/or trigger the Github Action
- Note how the value that gets printed out is
(placeholder)
and not the expectedHello World