-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: github_actions_organization_secret - Provider produced inconsistent result after apply #1924
Comments
I've got the same error:
This secret was initially imported and worked fine. After this failed apply (changing
if I run plan it says
so I'm not sure if this will destroy the existing secret, replace it, or have no effect. Same thing happens with a |
👋 Hey Friends, this issue has been automatically marked as |
This still happens |
minimal reproducible example: provider "github" {}
resource "github_repository" "test_repo_1" {
name = "tf-acc-test-1"
}
resource "github_repository" "test_repo_2" {
name = "tf-acc-test-2"
}
variable use_both_repos {
type = bool
}
resource "github_actions_organization_secret" "main" {
secret_name = "BLAAA"
plaintext_value = "aaa"
visibility = "selected"
selected_repository_ids = var.use_both_repos ? [
github_repository.test_repo_1.repo_id,
github_repository.test_repo_2.repo_id
] : [github_repository.test_repo_1.repo_id]
} and run gh auth login
gh auth refresh --scopes admin:org
export GITHUB_OWNER=test-org-for-tf-1
terraform apply -var use_both_repos=true -auto-approve
terraform apply -var use_both_repos=false -auto-approve |
The underlying issue is that changing This in turn results in us identifying that the secret's value change, which results in the creation of a new secret (which #2499 converts to an update, separate issue #1383). AFAIK this is not possible to mitigate - we have no mechanism to distinguish whether IMO we need to escalate to GitHub's API team - imo they need to provide a |
Expected Behavior
No errors when updating
github_actions_organization_secret
selected_repository_ids
Actual Behavior
Applying this change
Results in
The same bug is also present with
github_dependabot_organization_secret
using the same config.After the apply, the next plan wants to create the resource.
Terraform Version
Terraform v1.5.4
on darwin_amd64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
Update the list of
selected_repository_ids
then applyDebug Output
No response
Panic Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: