[BUG]: Repository 'security_and_analysis' settings are being sent even if they are unset, unchanged, or part of 'lifecycle.ignore_changes' #2252
Labels
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Bug
Something isn't working as documented
Expected Behavior
If the 'security_and_analysis' block is either unset, unchanged, or ignored by Terraform by using the
ignore_changes
list in thelifecycle
block of agithub_repository
, thenterraform apply
should not send that block to the GitHub API.Actual Behavior
The block above is sent to the GitHub API, which causes an issue even if it isn't a change.
This becomes an issue if/when the repository has an enterprise policy that prevents modifying the advanced security enablement:
│ Error: PATCH https://api.github.com/repos/$ORG_REDACTED/$REPO_REDACTED: 422 An enterprise policy prevented modifying advanced security enablement. Contact your enterprise owner for details. [] │ │ with github_repository.all['$REPO_REDACTED'], │ on main.tf line 1, in resource "github_repository" "all": │ 1: resource "github_repository" "all" {
Terraform Version
Terraform v1.8.2
on darwin_arm64
Affected Resource(s)
github_repository
Terraform Configuration Files
Steps to Reproduce
No response
Debug Output
Panic Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: