Repository navigation
Fix duplicate path entries - #57
Merged
Merged
Conversation
Writing the path to GITHUB_PATH, then copying all of `env` (which includes `$env:Path`) doubles up the path. This can increase the path above cmd.exe's 8191 character limit, which causes it to be ignored in some invocations. (It also expects individual paths, not the entire colon-separated path variable, see https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#adding-a-system-path)
speednoisemovement
marked this pull request as ready for review
September 18, 2026 19:09
compnerd
requested changes
Sep 18, 2026
compnerd
left a comment
Owner
There was a problem hiding this comment.
I think that we can split $env:Path on ; and write them individually to GITHUB_PATH. We can filter out $env:Path when writing GITHUB_ENV. I'd rather keep Path in GITHUB_PATH and the remainder of the environment in GITHUB_ENV.
compnerd
reviewed
Sep 18, 2026
compnerd
approved these changes
Sep 18, 2026
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.
This action currently leaves the environment with a duplicated path:
$env:Pathwhile copying the environmentGITHUB_PATHAs a consequence, the path can go over
cmd.exe's limit of 8191, which causes it to be ignored.This change explicitly clears
PathinGITHUB_ENVand filters it out of the copy. It also writes the individual path directories toGITHUB_PATHone at a time, rather than writing the entire colon-separated string.