Migration from deprecated add-path on windows

Hi,

I’m having trouble migrating from the deprecated add-path to the environment files system. Previously, our step looked like this:

      - name: Add Growl Installer to Path (Windows)
        run: 'echo "::add-path::C:\Program Files (x86)\Growl for Windows"'

From the docs, it looks like it should be changed to:

      - name: Add Growl Installer to Path (Windows)
        run: echo "C:\Program Files(x86)\Growl for Windows" >> $GITHUB_PATH

However, this fails to set the path as expected, and executables in the above folder cannot be found.

Is there a different way to do this on Windows?

Given the default shell on Windows is PWSH it would probably be

 - name: Add Growl Installer to Path (Windows)
    run: echo "C:\Program Files(x86)\Growl for Windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8

Thanks. This doesn’t seem to work, as the Growl executable cannot be found.

Here’s the workflow file in its entirety.

It works fine using add-path, but not with the new environment file.

Hey @boneskull, you seem to be setting different paths when using the set-env and GITHUB_PATH. Take a look at the revert PR here. Notice how the space between “Program Files” and “(x86)”.
is changed as well.

Could you please try:

run: echo "C:\Program Files (x86)\Growl for Windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8

oh jeez… it’s been that kind of week

that worked, thanks for your help!

1 Like