How to add to Path on ubuntu linux correctly?

Hi,

The GITHUB_PATH does not seem to work for ubuntu-latest by following the doc

      - name: Foobar
        run: |
          wget https://xxxxx/foobar
          chmod +x ./foobar
          echo "$(pwd)/foobar" >> $GITHUB_PATH          

The output for $GITHUB_PATH outputs empty

It looks like you’re trying to add an executable file to the PATH. That won’t work (in general, not specific to GitHub Actions), you need to add the directory containing the executable. Make sure the directory you use a directory that does not contain any other executables which you don’t want on the path.

The other option would be to add a symlink to the executable in a directory (like /usr/bin/) that’s already part of $PATH.

1 Like