[BUG]: github_issue_labels
can't clobber existing labels
#2089
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
I expected the
github_issue_labels
resource to allow me to specify the full list of issue labels I want, even if those issue labels overlap some of the default ones created in a new GitHub repo, or include other existing labels in the repo.Actual Behavior
When using
github_issue_labels
with a set of labels that includes an existing label, the apply fails with an error like:{"@level":"error","@message":"Error: POST https://api.github.com/repos/org/repo/labels: 422 Validation Failed [{Resource:Label Field:name Code:already_exists Message:}]","@module":"terraform.ui","@timestamp":"2024-01-10T04:48:36.512181Z","diagnostic":{"severity":"error","summary":"POST https://api.github.com/repos/org/repo/labels: 422 Validation Failed [{Resource:Label Field:name Code:already_exists Message:}]","detail":"","address":"module.name.github_issue_labels.this","range":{"filename":"modules/repo/issue-labels.tf","start":{"line":8,"column":39,"byte":246},"end":{"line":8,"column":40,"byte":247}},"snippet":{"context":"resource \"github_issue_labels\" \"this\"","code":"resource \"github_issue_labels\" \"this\" {","start_line":8,"highlight_start_offset":38,"highlight_end_offset":39,"values":[]}},"type":"diagnostic"}
This makes it impossible to use this resource with a set of labels that includes any of the default labels for new repos. This would be fine if you could simply omit those labels, but if you do, the default labels will be removed on subsequent runs.
Terraform Version
Affected Resource(s)
github_issue_labels
Terraform Configuration Files
No response
Steps to Reproduce
No response
Debug Output
No response
Panic Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: