{"record":{"id":"b10f1d2c4ad453f7","repo":"nektos/act","slug":"s-in-map-key-not-implemented","errorCode":null,"errorMessage":"'%s' in map key not implemented","messagePattern":"'(.+?)' in map key not implemented","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/exprparser/interpreter.go","lineNumber":295,"sourceCode":"\t\t\t}\n\t\t\treturn string(text), nil\n\t\t}\n\t\treturn i, nil\n\n\tcase reflect.Map:\n\t\titer := left.MapRange()\n\n\t\tfor iter.Next() {\n\t\t\tkey := iter.Key()\n\n\t\t\tswitch key.Kind() {\n\t\t\tcase reflect.String:\n\t\t\t\tif strings.EqualFold(key.String(), property) {\n\t\t\t\t\treturn impl.getMapValue(iter.Value())\n\t\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"'%s' in map key not implemented\", key.Kind())\n\t\t\t}\n\t\t}\n\n\t\treturn nil, nil\n\n\tcase reflect.Slice:\n\t\tvar values []interface{}\n\n\t\tfor i := 0; i < left.Len(); i++ {\n\t\t\tvalue, err := impl.getPropertyValue(left.Index(i).Elem(), property)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tvalues = append(values, value)\n\t\t}\n\n\t\treturn values, nil","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/exprparser/interpreter.go#L277-L313","documentation":"Same code path as the map-key error at pkg/exprparser/interpreter.go:295: property lookup iterates a map with MapRange and rejects any key whose reflect.Kind is not String, embedding the kind name in the message. It guards the dot-notation (.foo) accessor only.","triggerScenarios":"Evaluating x.prop where x is a map[interface{}]interface{} or map[int]string; JSON decoded with number keys under act's untyped unmarshaling; composite-action inputs building non-string keyed maps.","commonSituations":"Dot access on fromJSON results with non-string keys; env data injected by custom embedding code; YAML !!int keys flowing into the expression environment.","solutions":["Switch to bracket access with a string index for such keys.","Normalize maps to string keys before they enter expressions.","Restructure source data to use string keys or arrays."],"exampleFix":"# go embedding\n// before\nenv.Vars = map[int]string{1: 'a'}\n// after\nenv.Vars = map[string]string{'1': 'a'}","handlingStrategy":"validation","validationCode":"func normalizeMapKeys(v interface{}) interface{} {\n  switch t := v.(type) {\n  case map[interface{}]interface{}:\n    out := map[string]interface{}{}\n    for k, val := range t { out[fmt.Sprintf('%v', k)] = normalizeMapKeys(val) }\n    return out\n  case map[string]interface{}:\n    for k, val := range t { t[k] = normalizeMapKeys(val) }\n  }\n  return v\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inject only map[string]interface{} into the expression env","Quote numeric keys in source JSON","Use index syntax for keys that are not valid identifiers"],"tags":["expressions","map-key","type-mismatch","interpreter"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}