"set-env" depracation warning when running "dotnet build"

My workflow keeps getting these deprecation warning messages.
I upgraded all used actions to newest versions (actions/checkout@v2.2.3 and actions/setup-dotnet@v1.7.2) and most of the warnings disappeared.
Now I only get these warnings on a simple “run” step which looks like this:

  • name: Build
    run: dotnet build src/Main/Main.csproj --configuration Release
    working-directory: ./

How can I figure out what is the issue?
I’m simply calling “dotnet build”.

Also, I do declare 2 environment variables using the “env:” syntax at the workflow level. Could that be the issue?

env: is completely unrelated. Only ::set-env is deprecated.

Many actions depend on @actions/core. It implemented the new way to set env vars via environment files in v1.2.6. Several official actions still use an older version however, and may thus cause the deprecation warning to show.

See e.g. https://github.com/actions/checkout/issues/380