'actions/setup-java@v1' removes everything from $PATH


I’ve had a lot of weird issues at each stage of my pipeline and all of them seemed to have been resolved by setting the $PATH variable to /bin etc within the step or by hard coding /bin/chmod and /bin/ssh rather than using chmod and ssh for example.

I have tracked down the issue to the actions/setup-java@v1 step replacing the contents of $PATH with the path of the JDK.

I call it like this:

      - name: Set up JDK 13
        uses: actions/setup-java@v1
          java-version: 13

Before that step, echo $PATH outputs: /usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin

Whereas after that step, echo $PATH outputs:

Is there any way to report this bug or does anyone know if there is a way around this?

Thank you,

1 Like

That is a pretty interesting bug! :sweat_smile:

For reporting you could write an issue in the actions/setup-java repository. I really hope they respond soon, that sounds like something that could break a lot of things that use Java, but aren’t pure Java projects.

1 Like

Okay I’ve raised an issue for this here!