Skip to content

feat: add --apply-env-vars-to-build flag to push (#734) - #1345

Open
MatousMarik wants to merge 1 commit into
masterfrom
feat/push-apply-env-vars-to-build-734
Open

feat: add --apply-env-vars-to-build flag to push (#734)#1345
MatousMarik wants to merge 1 commit into
masterfrom
feat/push-apply-env-vars-to-build-734

Conversation

@MatousMarik

@MatousMarik MatousMarik commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Part of #734 (the applyEnvVarsToBuild toggle half).

What

  • New --apply-env-vars-to-build boolean flag on apify push — sets applyEnvVarsToBuild: true on the Actor version, so env vars from actor.json are also available during the Docker build.
  • When the flag is omitted, the field is left out of the API payload entirely, so a value previously set in Console is preserved (pushes to existing Actors don't reset it).
  • Regenerated docs/ via pnpm run update-docs.

Why

Env vars synced by apify push currently apply only at runtime; making them apply to the build requires flipping a switch in Console. That breaks CI and fresh pushes of Actors that need build-time secrets (e.g. a GitHub token as a Docker build arg).

Tests

  • New [api] test in test/api/commands/push.test.ts: push with the flag → version has applyEnvVarsToBuild: true; push again without it → value preserved. Full push API suite passes (13/13), plus test:local, lint, format, build.

Follow-ups (separate PRs)

No new dependencies; no install-size impact.

Allows env vars from actor.json to be applied to the Actor build
process (Docker build args) without flipping the switch in Console.
When the flag is omitted, the value stored on the platform is kept.
@MatousMarik
MatousMarik force-pushed the feat/push-apply-env-vars-to-build-734 branch from f9e8ca3 to 9c96569 Compare August 24, 2026 14:39
@MatousMarik
MatousMarik marked this pull request as ready for review August 24, 2026 14:55
@MatousMarik MatousMarik self-assigned this Aug 24, 2026
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.

2 participants