{"record":{"id":"817a4ef229bf0a75","repo":"nodejs/node","slug":"unrecognized-action-action-in-name-key-regex","errorCode":null,"errorMessage":"Unrecognized action {action} in {name} key {regex_key}","messagePattern":"Unrecognized action (.+?) in (.+?) key (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/input.py","lineNumber":2603,"sourceCode":"\n            # The \"whatever!\" list is no longer needed, dump it.\n            del the_dict[exclude_key]\n\n        regex_key = list_key + \"/\"\n        if regex_key in the_dict:\n            for regex_item in the_dict[regex_key]:\n                [action, pattern] = regex_item\n                pattern_re = re.compile(pattern)\n\n                if action == \"exclude\":\n                    # This item matches an exclude regex, set its value to 0 (exclude).\n                    action_value = 0\n                elif action == \"include\":\n                    # This item matches an include regex, set its value to 1 (include).\n                    action_value = 1\n                else:\n                    # This is an action that doesn't make any sense.\n                    raise ValueError(\n                        \"Unrecognized action \"\n                        + action\n                        + \" in \"\n                        + name\n                        + \" key \"\n                        + regex_key\n                    )\n\n                for index, list_item in enumerate(the_list):\n                    if list_actions[index] == action_value:\n                        # Even if the regex matches, nothing will change so continue\n                        # (regex searches are expensive).\n                        continue\n                    if pattern_re.search(list_item):\n                        # Regular expression match.\n                        list_actions[index] = action_value\n\n            # The \"whatever/\" list is no longer needed, dump it.","sourceCodeStart":2585,"sourceCodeEnd":2621,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/input.py#L2585-L2621","documentation":"Regex list filters use [action, pattern] tuples where action must be 'exclude' or 'include'. Any other action string raises ValueError (note: ValueError) naming the bad action, the dict name, and the regex key.","triggerScenarios":"A regex filter list (key ending in '/') contains a tuple whose first element is neither 'exclude' nor 'include'. Also fires if the tuple is malformed such that action resolves to an unexpected value.","commonSituations":"Typo like 'exlude' or 'inc'; copy-paste from docs that used a different verb; generator emitting custom action verbs; structural change to the tuple format.","solutions":["Use only 'exclude' or 'include' as the action in each regex tuple.","Spell-check the action verb.","Update generators to emit only the two supported actions."],"exampleFix":"// before: 'sources/': [['exlude', '.*\\\\.test\\\\.cc$']]\n// after: 'sources/': [['exclude', '.*\\\\.test\\\\.cc$']]","handlingStrategy":"validation","validationCode":"for k, lst in the_dict.items():\n    if k[-1:] == '/':\n        for action, pattern in lst:\n            assert action in ('exclude', 'include'), 'bad action %r in %s' % (action, k)\n","typeGuard":"def valid_regex_actions(lst): return all(a in ('exclude','include') for a, _ in lst)","tryCatchPattern":"try:\n    gyp.main(args)\nexcept ValueError as e:\n    if 'Unrecognized action' in str(e): print('Use only exclude/include'); raise","preventionTips":["Use only 'exclude' or 'include' as regex actions.","Spell-check action verbs.","Validate generator-emitted regex tuples."],"tags":["gyp","list-filter","regex","validation","build-config"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}