Why is it a bad idea to store structured data like JSON or a whole `.env` file as one secret?
IntermediateConceptSecrets, Variables, Environments & Permissions
Answer
Masking works on the whole registered value and on individual lines of a multiline secret, but not on fields inside JSON on one line. If a tool prints one field, it appears unmasked. You also lose the ability to rotate or scope individual values. Store one secret per value, or keep structured config in a secret manager and register each retrieved value with ::add-mask::.
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?BeginnerWhat is an environment, and which protection rules can it have?BeginnerWhen does a job wait for environment approval, and what does the reviewer see?IntermediateHow do deployment branch policies interact with tags and `workflow_dispatch`?Advanced