MCPcopy Create free account
hub / github.com/github/gh-aw / mergeCommandOtherEvents

Function mergeCommandOtherEvents

pkg/workflow/trigger_parser.go:712–728  ·  view source on GitHub ↗
(existing map[string]any, incoming map[string]any)

Source from the content-addressed store, hash-verified

710}
711
712func mergeCommandOtherEvents(existing map[string]any, incoming map[string]any) map[string]any {
713 if len(existing) == 0 {
714 return incoming
715 }
716 if len(incoming) == 0 {
717 return existing
718 }
719 merged := maps.Clone(existing)
720 for eventName, incomingValue := range incoming {
721 if existingValue, hasExisting := merged[eventName]; hasExisting {
722 merged[eventName] = mergeEventConfig(existingValue, incomingValue)
723 continue
724 }
725 merged[eventName] = incomingValue
726 }
727 return merged
728}
729
730func mergeEventConfig(existing any, incoming any) any {
731 existingMap, existingOK := existing.(map[string]any)

Callers 1

parseOnSectionMethod · 0.85

Calls 2

mergeEventConfigFunction · 0.85
CloneMethod · 0.45

Tested by

no test coverage detected