diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index 510e483e3..52e478426 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -214,7 +214,9 @@ export class ActorsPushCommand extends ApifyCommand { actorId = actor.id; } else { const { templates } = await fetchManifest(); - const actorTemplate = templates.find((t) => t.name === actorConfig!.template); + const actorTemplate = templates.find( + (t) => t.name === actorConfig!.template || t.aliases?.includes(actorConfig!.template as string), + ); const defaultRunOptions = (actorTemplate?.defaultRunOptions || DEFAULT_RUN_OPTIONS) as ActorDefaultRunOptions; const newActor: ActorCollectionCreateOptions = { name: actorConfig!.name as string, diff --git a/src/lib/create-utils.ts b/src/lib/create-utils.ts index 72b973b83..64622f554 100644 --- a/src/lib/create-utils.ts +++ b/src/lib/create-utils.ts @@ -33,7 +33,9 @@ export async function getTemplateDefinition( if (manifest instanceof Error) throw manifest; if (maybeTemplateName) { - const templateDefinition = manifest.templates.find((t) => t.name === maybeTemplateName); + const templateDefinition = manifest.templates.find( + (t) => t.name === maybeTemplateName || t.aliases?.includes(maybeTemplateName), + ); if (!templateDefinition) { throw new Error(`Could not find the selected template: ${maybeTemplateName} in the list of templates.`); }