Skip to content
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]: State refresh for environment_secret fails when repo deleted outside terraform #2407

Closed
1 task done
scootafew opened this issue Oct 2, 2024 · 1 comment · Fixed by #2323
Closed
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@scootafew
Copy link
Contributor

Expected Behavior

Terraform should recognize that if the repo no longer exists then neither can the environment secret and it should gracefully remove the environment_secret from the state.

Actual Behavior

An error when running terraform destroy on a repo which was already deleted outside terraform:

module.github.github_actions_environment_secret.secrets["MY_SECRET"]: Refreshing state... [id=repo:main:MY_SECRET]
╷
│ Error: GET https://api.github.com/repos/org/repo: 404 Not Found []
│ 
│   with module.github.github_actions_environment_secret.secrets["MY_SECRET"],
│   on ../core/github/main.tf line 134, in resource "github_actions_environment_secret" "secrets":
│  134: resource "github_actions_environment_secret" "secrets" {
│ 
╵

This is essentially the same issue as #1853 & #1864 but for a different resource.

Terraform Version

Using provider version 6.2.3

Affected Resource(s)

  • github_actions_environment_secret

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@scootafew scootafew added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Oct 2, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Oct 2, 2024
@scootafew
Copy link
Contributor Author

I actually already raised #2323 to address this, but creating the related issue now to try and get some traction on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
1 participant