Skip to content

feat: add apify create --into to scaffold an Actor into an existing repository - #1653

Draft
DaveHanns wants to merge 1 commit into
masterfrom
feat/create-into
Draft

DaveHanns wants to merge 1 commit into
masterfrom
feat/create-into

Conversation

@DaveHanns

Copy link
Copy Markdown
Contributor

Summary

  • apify create <name> --into <dir> creates the Actor in <dir>/<name> and creates missing folders. It fails before any write when combined with a Git --source, which creates a new repository. With --into, an interactive run uses the apify source without asking.
  • Inside an existing Git work tree, create no longer runs git init, with or without --into, and says which repository the Actor is in. It used to check only <cwd>/.git, so an Actor created in a subfolder got a nested repository.
  • When the template's Dockerfile declares ARG ACTOR_PATH_IN_DOCKER_CONTEXT, create writes dockerContextDir pointing at the repository root: the Git root, or the current folder with --into outside Git. Such a Dockerfile builds from the repository root, like the planned ts-monorepo template (Add a TypeScript Actor template for monorepos actor-templates#1056). Other templates get no dockerContextDir, because without it the platform builds from the Actor folder.
  • Outside Git, when create writes dockerContextDir, it skips git init in the Actor folder and says to initialize the repository at the root instead. A repository in the Actor folder wouldn't hold the folder dockerContextDir points to, and apify push would refuse it.
  • The next-step cd line shows the path from the current folder.

Tests

  • New test/local/commands/create-into.test.ts, 11 cases with no network. Each fails without this change.
  • create.test.ts sets GIT_CEILING_DIRECTORIES: its temp folders sit inside this checkout, so they'd now count as being inside a repository. The existing-repository test uses a real git init instead of an empty .git folder, which Git ignores.
  • lint, format, build, and test:local pass, apart from the two Python fixture tests that fail only on the local machine.

Closes #1425

🤖 Generated with Claude Code

… repository

`--into <dir>` creates the Actor in `<dir>/<name>`, making missing folders.
It's rejected with a Git `--source`, which creates a new repository.

`create` no longer runs `git init` when the Actor's parent folder is inside
a Git work tree, so it doesn't nest a repository in a monorepo.

A template whose Dockerfile declares `ARG ACTOR_PATH_IN_DOCKER_CONTEXT`
builds from the repository root, so `create` sets `dockerContextDir` in
`.actor/actor.json` to the Git root, or to the current directory with
`--into` outside Git.
@pkg-pr-new

pkg-pr-new Bot commented Nov 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/apify-cli@1653

commit: 60d8fe0

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apify create --into: scaffold an Actor into an existing repository

1 participant