feat(env): add Windows user profile variables to pass-through #10588
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.
Add USERPROFILE, HOMEDRIVE, and HOMEPATH to the built-in environment variables pass-through list to ensure proper path resolution in Windows environments.
Description
Resolves #10587
When running AWS SAM CLI from tasks, the following error occurs because profiles cannot be referenced:
This happens because Python's
os.path
module references environment variables such asUSERPROFILE
,HOMEDRIVE
, andHOMEPATH
to obtain user paths in Windows environments, but these variables are not included in the default pass-through list, making them inaccessible within tasks.https://github.com/python/cpython/blob/f4911258a80409cb641f13578137475204ab43b5/Lib/ntpath.py#L360-L366
Since these are standard Windows environment variables, I propose adding them to the default pass-through list.
Testing Instructions
Add an AWS SAM project to a Turborepo child project, configure a script with the
--profile
option, and run it as a task.