feat: add --apply-env-vars-to-build flag to push (#734) - #1345
Open
MatousMarik wants to merge 1 commit into
Open
feat: add --apply-env-vars-to-build flag to push (#734)#1345MatousMarik wants to merge 1 commit into
MatousMarik wants to merge 1 commit into
Conversation
MatousMarik
force-pushed
the
feat/push-apply-env-vars-to-build-734
branch
from
August 24, 2026 14:39
f9e8ca3 to
9c96569
Compare
MatousMarik
marked this pull request as ready for review
August 24, 2026 14:55
MatousMarik
requested review from
DaveHanns,
l2ysho and
szaganek
as code owners
August 24, 2026 14:55
MatousMarik
force-pushed
the
feat/push-apply-env-vars-to-build-734
branch
from
August 25, 2026 07:42
9c96569 to
923d4a8
Compare
Allows env vars from actor.json to be applied to the Actor build process (Docker build args) without flipping the switch in Console. --no-apply-env-vars-to-build explicitly turns the setting off. When the flag is omitted, the value stored on the platform is kept. The flag parser matched provided flags by truthiness, which dropped scalar false values injected by the test harness (the real CLI path always yields arrays via multiple: true and was unaffected); it now checks for presence so harness-injected negated booleans behave the same as parsed ones.
MatousMarik
force-pushed
the
feat/push-apply-env-vars-to-build-734
branch
from
August 25, 2026 09:16
923d4a8 to
420860a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #734 (the
applyEnvVarsToBuildtoggle half).What
--apply-env-vars-to-buildboolean flag onapify push— setsapplyEnvVarsToBuild: trueon the Actor version, so env vars fromactor.jsonare also available during the Docker build.--no-apply-env-vars-to-buildexplicitly turns the setting off._parseFlagsmatched provided flags by truthiness. The real CLI path is unaffected (multiple: truemeans values always arrive as arrays, which are truthy), buttestRunCommand/internalRunCommandinject scalar values, where an explicitfalsewas silently dropped. The matcher now checks for presence, and the required-flag check is aligned toundefined, so harness-injected negated booleans behave the same as parsed ones (the new test relies on this).docs/viapnpm run update-docs.Why
Env vars synced by
apify pushcurrently 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
[api]test intest/api/commands/push.test.tscovering: flag →true, omitted → preserved, negated flag →false. Full push API suite passes (13/13), plustest:local, lint, format, build.Follow-ups (separate PRs)
applyEnvVarsToBuildfield in.actor/actor.json(feat: read applyEnvVarsToBuild from actor.json in push (#734) #1346, stacked on this).--env KEY=VALUEpassing on push (the other half of Pass environment variables toapify pushand toggleapplyEnvVarsToBuild#734).No new dependencies; no install-size impact.