Set-env and add-path deprecation warning

I am not using set-env or add-path in my ci.yml but I am still getting warnings that they are soon going to be deprecated.

For eg here -

This is my ci.yml -

How do I fix this?

I see two possible causes:

  1. An action you’re using is using those commands. That seems unlikely because the only action you’re using is actions/checkout, but updating it to v2 instead of v1 may be a good idea anyway.
  2. Some script or other tool you’re running is issuing set-env or add-path commands.

I noticed the failures affect only the macos builds, and indeed the macports-ci script you’re downloading there contains at least an add-path command. It is also downloading and running additional tools, so those probably cause the other warnings.

You could file an issue against the source repository of that script and hope for a patch, or find another way to set up macports.


  1. I disagree. Many actions rely on @actions/core, which implements the function that lets you set environment variables. The recently released v1.2.6 contains a change to use environment files instead, but other actions have yet to update this dependency, including official ones like checkout.

I’m not seeing any warnings on my workflows that use actions/checkout@v2, so I’m pretty sure it’s not the case there. Unless there’s some code that only runs on Macos or Windows, I wouldn’t notice in that case. :wink:

What I mean is that many actions rely on @actions/core, and a lot of official actions haven’t had their dependencies updated for quite a while. But you are right that the checkout action doesn’t call exportVariable() or addPath(). My mistake!

1 Like