Interview Prep/GitHub Actions/Secrets, Variables, Environments & Permissions

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::.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, Variables, Environments & Permissions