Fixes a problem where the env variable was being set in the wrong spot in #12951 Release Notes: - N/A