Masking variables using add-mask - GitHub Actions


We are testing out Actions for our Docker builds to push them to ECR. We noticed that it shows certain information that we would like to mask, but cannot get it to do so. We have the following:

echo ::set-output name=password::"${connectionParts[1]}"

We would like to do:

echo ::set-output name=password::"${connectionParts[1]}"
echo ::add-mask::${PASSWORD}

but it doesn’t seem to work. Any suggestions? TIA!

Make sure the environment variable $PASSWORD is defined in your script and has the same value as ${connectionParts[1]}. If $PASSWORD is not defined you are adding an empty value to the mask.