Skip to content
Prev Previous commit
Next Next commit
fix(governance): preserve custom property item type
Co-authored-by: Patrick Knight <patrick-knight@github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e886867-a922-419a-b02c-ac643716aea8
  • Loading branch information
3 people committed Sep 3, 2026
commit 8e921ba08be29e2272217f0a828fd2e0772555e8
3 changes: 2 additions & 1 deletion pkg/github/__toolsnaps__/custom_properties_write.snap
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
],
"type": "object"
}
]
],
"type": "object"
},
"type": "array"
},
Expand Down
1 change: 1 addition & 0 deletions pkg/github/custom_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func CustomPropertiesWrite(t translations.TranslationHelperFunc) inventory.Serve
Type: "array",
Description: "The custom properties to create or update. At the repository level each item assigns a value ('property_name' and 'value'); at the organization and enterprise levels each item defines the schema ('property_name' and 'value_type', plus optional definition fields).",
Comment thread
Copilot marked this conversation as resolved.
Items: &jsonschema.Schema{
Type: "object",
OneOf: []*jsonschema.Schema{
customPropertyValueSchema(),
customPropertyDefinitionSchema(),
Expand Down
1 change: 1 addition & 0 deletions pkg/github/custom_properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func Test_CustomPropertiesWrite(t *testing.T) {

t.Run("property items use level-specific schemas", func(t *testing.T) {
itemSchema := schema.Properties["properties"].Items
assert.Equal(t, "object", itemSchema.Type)
require.Len(t, itemSchema.OneOf, 2)
valueItemSchema := itemSchema.OneOf[0]
definitionItemSchema := itemSchema.OneOf[1]
Expand Down