You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When github_actions_secret is changes via gui, it will be re-created #964
Changes to Secrets made from GitHub Gui should be ignored
Actual Behavior
Secret will be re-created
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Repo is created from a template. Could this be the reason?
Reacted by Gonzalo Foligna, super-mcgin, Eligio Mariño, Sergio Saiz, Alain Vallejo Paredes, Alberto Redondo, Magnus Jensen, Nick Williams, Nikolas Grottendieck, Motoki KAMIMURA and 1 more
This is expected, terraform is fixing config drift. Changes to a terraform managed resource made outside of terraform will be put back when terraform applies.
Things should either be managed through terraform or not... there is no middle path.
I think the ignore_changes lifecycle argument is there on purpose.
I'm having the same issue. I get a total new creation of the github_actions_secret every time I plan and apply.
None of the arguments from ignore_changes works for me.
TF ver 0.13.5
GitHub provider ver 4.7.0 (latest as of today)
This is expected, terraform is fixing config drift. Changes to a terraform managed resource made outside of terraform will be put back when terraform applies.
Things should either be managed through terraform or not... there is no middle path.
Reacted by Arne, Pierre Nicolas Durette, Murukesh Mohanan, Brisilda Munguli and Nikita K
Our intention at the moment is to provision the secrets without the values (just as a templating) to then manually update the secret values, but every time we do it the resource gets destroyed and recreated again.
Reacted by Arne, Jeremy Witte, WTPOptAxe, Greg, Pierre Nicolas Durette, Eligio Mariño, Alain Vallejo Paredes, Nick Williams and Stefan Jokic
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
I can create an "empty" secret with terraform, then manage the secret_version out of terraform state.
It would be nice to manage github secrets in a similar way. The day 1, I want to create the secret with terraform but, day 2, manage the rotation with a separated tool.
Reacted by Alberto Redondo, Alain Vallejo Paredes, Nick Williams and Stefan Jokic
This feels like another destroy_on_drift scenario much like this recent changeset. My guess from the discussion is that we need to add the property to resourceGithubActionsSecret for those who want to override the default behavior. I can work up a PR but I'd like another confirmation as a gut check to ensure I'd be addressing the actual need here.
I'll work something up with schema migrations as well to help to close this out.
// This is a drift detection mechanism based on timestamps.
//
// If we do not currently store the "updated_at" field, it means we've only
// just created the resource and the value is most likely what we want it to
// be.
//
// If the resource is changed externally in the meantime then reading back
// the last update timestamp will return a result different than the
// timestamp we've persisted in the state. In that case, we can no longer
// trust that the value (which we don't see) is equal to what we've declared
// previously.
//
// The only solution to enforce consistency between is to mark the resource
// as deleted (unset the ID) in order to fix potential drift by recreating
// the resource.
Why doesnt it respect prevent_destroy / ignore_changes?
Activity
thekbb commentedon Nov 2, 2021
This is expected, terraform is fixing config drift. Changes to a terraform managed resource made outside of terraform will be put back when terraform applies.
Things should either be managed through terraform or not... there is no middle path.
gfoligna-nyshex commentedon Nov 5, 2021
I think the
ignore_changeslifecycle argument is there on purpose.I'm having the same issue. I get a total new creation of the
github_actions_secretevery time I plan and apply.None of the arguments from
ignore_changesworks for me.TF ver 0.13.5
GitHub provider ver 4.7.0 (latest as of today)
gfoligna-nyshex commentedon Nov 5, 2021
Also this relates to #749
gfoligna-nyshex commentedon Nov 5, 2021
One more thing: v0.14.1 claims to have this error fixed. Tested and it is still not working (actually just worked once).
atanaspam commentedon Nov 8, 2021
We are also running into this issue.
Seems to be related to this piece of code that does not respect the
ignore_changeslifecycle argument.yordis commentedon Nov 5, 2022
Following this,
Our intention at the moment is to provision the secrets without the values (just as a templating) to then manually update the secret values, but every time we do it the resource gets destroyed and recreated again.
github-actions commentedon Aug 3, 2023
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!yordis commentedon Aug 3, 2023
keep
github-actions commentedon May 3, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!yordis commentedon May 3, 2024
Could somebody try to directly help at #1351
2 remaining items
mrsaiz commentedon May 8, 2024
We are also facing this issue. In AWS terraform provider, the way it is manage is using two different resources, secret and secret_version.
I can create an "empty" secret with terraform, then manage the secret_version out of terraform state.
It would be nice to manage github secrets in a similar way. The day 1, I want to create the secret with terraform but, day 2, manage the rotation with a separated tool.
nickfloyd commentedon Oct 27, 2025
This feels like another
destroy_on_driftscenario much like this recent changeset. My guess from the discussion is that we need to add the property toresourceGithubActionsSecretfor those who want to override the default behavior. I can work up a PR but I'd like another confirmation as a gut check to ensure I'd be addressing the actual need here.I'll work something up with schema migrations as well to help to close this out.
oskarsword commentedon Dec 10, 2025
I dont think it was implemened for github environment secrets.
This is the comment inside github environment secret resource:
terraform-provider-github/github/resource_github_actions_organization_secret.go
Line 198 in b413047
Why doesnt it respect prevent_destroy / ignore_changes?