Skip to content

Stop writing an empty environmentVariables to actor.json #1566

Open

Description

@DaveHanns

apify init writes "environmentVariables": {} into .actor/actor.json, and so does apify create for a template without an actor.json. On apify push, the empty object is truthy, so the CLI sends envVars: [] and deletes every env var set in Apify Console. This is the most common way Console values get wiped, and the fix is safe to ship on its own.

Scope

  • Remove environmentVariables from EMPTY_LOCAL_CONFIG (src/lib/consts.ts).
  • In apify push, treat an empty environmentVariables object as absent, so existing projects stop wiping the list (src/commands/actors/push.ts).
  • Copy EMPTY_LOCAL_CONFIG in apify create instead of mutating the shared object (src/commands/create.ts).

Done when

  • apify init followed by apify push to an existing Actor leaves the Actor's env vars untouched. An API test covers it.
  • A push with "environmentVariables": {} sends no envVars.

Activity

  1. added theissue type on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-buildersIssues owned by the Builders team.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions