How to hide environment values when {{}} is used in one step of workflow action

Hi there,
I am using environment-variables: Environment variables - GitHub Docs in my Github workflow, one step is like this:

When I use ${{}} in one step, like:

  run: |
    python --notebook_folder_directory ../samples --notebooks_to_skip **${{env.NOTEBOOKS_SKIP}}**

the Github outputs will print out all env variables and values, as shown in the figure above. However, env variables stores some secret values which I don’t want to be shown in the output.

So, how could I hide env variables shown in the output?


1 Like


Having the same request here and can’t find any documentation about it.

You can mask the values, just make sure to do that before setting them to the environment. That should happen automatically for secrets.

Hi, FDuhen, did you find any solution? :smiley:


Looks like the issue related to this question is still waiting to be resolved usage of add-mask still echoes the value to the log · Issue #475 · actions/runner · GitHub

I fixed my problem by writing an action whom job is to provide all the env vars I re-use in all of my projects.
While writing this action, I found out that I was able to force the “::add-mask” flag on top of my vars, hiding if from the logger