{"record":{"id":"66a4343c77c3f39a","repo":"dotnet/aspnetcore","slug":"the-action-action-is-not-supported","errorCode":null,"errorMessage":"The action ${action} is not supported.","messagePattern":"The action (.+?) is not supported\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"eng/scripts/npm/pack-workspace.mjs","lineNumber":65,"sourceCode":"  writeJsonSync(resolve(intermediateOutputPath, 'renames.json'), renames);\n} else if (action === '--create-packages') {\n  if (!existsSync(packageOutputPath)) {\n    throw new Error(`The package output path ${packageOutputPath} does not exist.`);\n  }\n\n  // Read packagesToPack and renames from a file\n  const packagesToPack = readJsonSync(resolve(intermediateOutputPath, 'packagesToPack.json'));\n  const renames = readJsonSync(resolve(intermediateOutputPath, 'renames.json'));\n  try {\n    createPackages(packagesToPack);\n  } finally {\n    // Restore the package.json files to their \"originals\"\n    for (const [from, to] of renames) {\n      moveSync(from, to, { overwrite: true });\n    }\n  }\n} else {\n  throw new Error(`The action ${action} is not supported.`);\n}\n\n// For each package to pack run npm pack\nfunction createPackages(packagesToPack) {\n  // The repo's LICENSE file lives at the root of the workspace next to package.json.\n  const licenseSourcePath = resolve(dirname(workspacePath), 'LICENSE.txt');\n  if (!existsSync(licenseSourcePath)) {\n    throw new Error(`The license file ${licenseSourcePath} does not exist.`);\n  }\n\n  for (const [packagePath, packageJson] of packagesToPack) {\n    const packageName = packageJson.name;\n    const packageVersion = defaultPackageVersion;\n    const packageDir = dirname(packagePath);\n    const normalizedPackageName = packageName.replace('@', '').replace('/', '-');\n    const packageFileName = `${normalizedPackageName}-${packageVersion}.tgz`;\n    const packageTarball = resolve(packageDir, `${packageFileName}`);\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/eng/scripts/npm/pack-workspace.mjs#L47-L83","documentation":"pack-workspace.mjs supports exactly two actions: --update-versions and --create-packages (pack-workspace.mjs:9,43-66). Any other value for the first positional argument falls into the else branch and throws.","triggerScenarios":"Invoking the script with an action that is neither --update-versions nor --create-packages (pack-workspace.mjs:64-66).","commonSituations":"A typo in the action string, a stale build script referencing a renamed action, or omitting the action so process.argv[2] is undefined.","solutions":["Use exactly '--update-versions' or '--create-packages' as the first positional argument.","Check for typos and trailing whitespace in the action passed by the build target.","If argv[2] is undefined, ensure the MSBuild Exec task actually passes the action property."],"exampleFix":"// before\nnode pack-workspace.mjs --create-package ./pkg/package.json 8.0.0 out int\n// after\nnode pack-workspace.mjs --create-packages ./pkg/package.json 8.0.0 out int","handlingStrategy":"validation","validationCode":"const VALID_ACTIONS = new Set(['--update-versions', '--create-packages']);\nif (!VALID_ACTIONS.has(action)) {\n    throw new Error(`Unsupported action '${action}'. Use one of: ${[...VALID_ACTIONS].join(', ')}`);\n}","typeGuard":"const isKnownAction = (a) => a === '--update-versions' || a === '--create-packages';","tryCatchPattern":null,"preventionTips":["Use exactly '--update-versions' or '--create-packages'.","Trim/validate the action before invoking.","Keep CI templates in sync if an action is renamed."],"tags":["nodejs","npm","cli","arguments","build"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}