What happens if a secret is printed in a different encoding, or split across lines?
IntermediateConceptSecrets, Variables, Environments & Permissions
Answer
It leaks. Masking replaces exact substrings only. echo $SECRET | base64, echo ${SECRET:0:10}, jq reformatting, or set -x output with escaping can all print unmasked forms. Never print secrets, avoid set -x in steps with secrets, and add masks for transformed forms you must generate (echo "::add-mask::$(echo -n "$S" | base64)"). Treat log access as secret access when in doubt, and rotate on any suspicion.
More on Secrets, Variables, Environments & Permissions
Where can secrets be defined, and what is the precedence?BeginnerHow are secrets protected in transit and in logs, and what are the limits?IntermediateAre secrets available to every step automatically?BeginnerWhy is it a bad idea to store structured data like JSON or a whole `.env` file as one secret?IntermediateWhat is an environment, and which protection rules can it have?BeginnerWhen does a job wait for environment approval, and what does the reviewer see?Intermediate