Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions github/resource_github_repository_custom_property.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func resourceGithubRepositoryCustomPropertyCreate(d *schema.ResourceData, meta a
// The propertyValue can either be a list of strings or a string
switch propertyType {
case github.PropertyValueTypeString, github.PropertyValueTypeSingleSelect, github.PropertyValueTypeURL, github.PropertyValueTypeTrueFalse:
if len(propertyValue) == 0 {
return fmt.Errorf("property_value must contain at least one element for property_type %q", propertyType)
}
customProperty.Value = propertyValue[0]
case github.PropertyValueTypeMultiSelect:
customProperty.Value = propertyValue
Expand Down