Skip to content

Fix duplicate path entries - #57

Merged
compnerd merged 3 commits into
compnerd:mainfrom
speednoisemovement:dup_path
Sep 18, 2026
Merged

compnerd merged 3 commits into
compnerd:mainfrom
speednoisemovement:dup_path

Conversation

@speednoisemovement

@speednoisemovement speednoisemovement commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

This action currently leaves the environment with a duplicated path:

  • Once from copying $env:Path while copying the environment
  • Once from writing to GITHUB_PATH

As a consequence, the path can go over cmd.exe's limit of 8191, which causes it to be ignored.

This change explicitly clears Path in GITHUB_ENV and filters it out of the copy. It also writes the individual path directories to GITHUB_PATH one at a time, rather than writing the entire colon-separated string.

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
speednoisemovement marked this pull request as ready for review September 18, 2026 19:09

@compnerd compnerd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@speednoisemovement speednoisemovement changed the title Don't write new path to GITHUB_PATH Fix duplicate path entries Sep 18, 2026
Comment thread action.yml Resolved
Comment thread action.yml Resolved
@compnerd
compnerd merged commit bbae8ce into compnerd:main Sep 18, 2026
5 checks passed
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