Couldn't run binary after using $GITHUB_PATH

Hi Github community,
I have trouble executing a binary I download since I stopped using the deprecated add-path command.

This worked for me:

      - name: Add workspace to path
        if: startsWith(runner.os, 'Windows')
        run: |
          echo "::add-path::${env:GITHUB_WORKSPACE}"
      - name: Install minio client
        if: startsWith(runner.os, 'Windows')
        run: |
          curl "https://dl.min.io/client/mc/release/windows-amd64/archive/mc.RELEASE.2020-08-08T02-33-58Z" --output mc.exe

now I switched to this:

      - name: Add workspace to path
        if: startsWith(runner.os, 'Windows')
        run: |
          echo "${GITHUB_WORKSPACE}" >> $GITHUB_PATH

      - name: Install minio client
        if: startsWith(runner.os, 'Windows')
        run: |
          curl "https://dl.min.io/client/mc/release/windows-amd64/archive/mc.RELEASE.2020-08-08T02-33-58Z" --output mc.exe

and the mc command isn’t recognized.

Thank you for your help!

That’s probably because you’re trying to use bash syntax on Windows without setting the shell to bash. See this thread for a similar problem, the solutions described there should work for you, too:

@airtower-luna thanks! It helped. Is this new? I never specified shell before, and everything was running well.

1 Like

I guess with the old add-path syntax the difference was small enough that in most cases it just worked. I mean, in echo "::add-path::${env:GITHUB_WORKSPACE}" the only difference is the env: prefix. :wink: