{"record":{"id":"34ba49c26753419a","repo":"GoogleContainerTools/skaffold","slug":"found-duplicate-custom-action-s-custom-action-na","errorCode":null,"errorMessage":"found duplicate custom action %s. Custom action names must be unique","messagePattern":"found duplicate custom action (.+?)\\. Custom action names must be unique","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":745,"sourceCode":"\t}\n\treturn errs\n}\n\n// validateCustomActions\n// - makes sure that each custom action name is unique\n// - makes sure that each custom action container name is unique\nfunc validateCustomActionsNames(runCtx *runcontext.RunContext) (errs []error) {\n\tacs := []latest.Action{}\n\tseenAcs := map[string]bool{}\n\tseenConts := map[string]bool{}\n\n\tfor _, pipeline := range runCtx.GetPipelines() {\n\t\tacs = append(acs, pipeline.CustomActions...)\n\t}\n\n\tfor _, a := range acs {\n\t\tif _, found := seenAcs[a.Name]; found {\n\t\t\terrs = append(errs, fmt.Errorf(\"found duplicate custom action %s. Custom action names must be unique\", a.Name))\n\t\t}\n\n\t\tfor _, c := range a.Containers {\n\t\t\tif _, found := seenConts[c.Name]; found {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"found duplicate container name %s in custom action. Container names must be unique\", c.Name))\n\t\t\t}\n\t\t\tseenConts[c.Name] = true\n\t\t}\n\n\t\tseenAcs[a.Name] = true\n\t}\n\n\treturn\n}\n\n// validateCustomActionsLists\n// - makes sure that each custom action has one or more containers\nfunc validateCustomActionsLists(runCtx *runcontext.RunContext) (errs []error) {","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L727-L763","documentation":"Custom action names must be unique across all pipelines in the run context because Skaffold references actions by name (e.g. in execution modes and pipelines). validateCustomActionsNames collects customActions from every pipeline and errors when a name repeats.","triggerScenarios":"Two customActions entries with the same `name:` across the pipelines of a run context, processed via ProcessWithRunContext.","commonSituations":"Copy-pasting a custom action without renaming it, or multi-config projects where each module defines an action with the same generic name like 'migrate-db'.","solutions":["Rename one of the duplicate custom actions to a unique name","Remove the accidental duplicate action","Prefix action names per module when combining multiple skaffold configs"],"exampleFix":"# before\ncustomActions:\n  - name: migrate\n    containers: [{ name: db, image: migrate:1 }]\n  - name: migrate\n    containers: [{ name: db2, image: migrate:2 }]\n# after\ncustomActions:\n  - name: migrate-v1\n    containers: [{ name: db, image: migrate:1 }]\n  - name: migrate-v2\n    containers: [{ name: db2, image: migrate:2 }]","handlingStrategy":"validation","validationCode":"const names = configs.flatMap(c => (c.customActions ?? []).map(a => a.name));\nconst dupes = names.filter((n, i) => names.indexOf(n) !== i);\nif (dupes.length) throw new Error(`duplicate custom actions: ${[...new Set(dupes)].join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await skaffold.run(config);\n} catch (e) {\n  if (/found duplicate custom action/.test(e.message)) {\n    console.error('Rename or remove the duplicated custom action');\n  } else throw e;\n}","preventionTips":["Prefix custom action names per module/config (e.g. payments-migrate)","Search all composed skaffold configs for the action name before adding it","Keep a naming convention doc for custom actions in multi-module repos"],"tags":["skaffold","config-validation","custom-actions","duplicate-names"],"backgroundTag":"skaffold-config-validation","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}