integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
885 stars 722 forks source link

Add ignoring feature for archived repositories #737

Open lens0021 opened 3 years ago

lens0021 commented 3 years ago

This is a feature request.

Recently, I have archived a repository that has issue labels are managed by Terraform. When I try to delete the declarations of labels in my tf file, Terraform fails to delete the labels. I do not want to delete the issue labels, they are in a repository already achieved and I don't want to touch them.

Terraform Version

Affected Resource

Debug Output

Error: DELETE https://api.github.com/repos/femiwiki/kubernetes/labels/REL1_35: 403 Repository was archived so is read-only. []

Expected Behavior

delete_on_destroy argument or something similar to the lifecycle Meta-Argument to avoid situations like above is provided

Actual Behavior

I have to remove the state manually, probably.

Steps to Reproduce

  1. Create a resource or import the state related to a repository.
  2. Archive the repository.
  3. Try to modify or delete the resource.
github-actions[bot] commented 1 year ago

👋 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!

kfcampbell commented 1 year ago

I think this issue is still valid so I've removed the stale tag for now. PRs are appreciated!

owlot commented 1 year ago

We have the same type of issue with handling repository file with Terraform and archiving a repository. Terraform will still try to apply changes to the files, and we have no way to prevent it other than manually removing all the Terraform managed files from the state when archiving.

github-actions[bot] commented 4 months ago

👋 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!

SebasAnasco1517 commented 1 month ago

Is this somehow took into account in a new version?

jmalloc commented 1 month ago

Such a feature would be fantastic for github_repository_file. In my case it's that I don't want to update the file content for archived repos, which fails with the same 403 Repository was archived so is read-only. error.