Parse JSON secrets into environment variables
mainBy default, parse-json-secrets is false, and the entire secret value is set as a single environment variable.
Set parse-json-secrets: true to create individual environment variables for every key-value pair within a JSON secret.
Naming Convention: When parsing JSON, the environment variable name is constructed as {SECRET_NAME}_{JSON_KEY_NAME}.
Warning: If your JSON uses case-sensitive keys that result in duplicate environment variable names (e.g., "name" and "Name"), the action will fail. In such cases, set parse-json-secrets: false and parse the JSON manually in a subsequent step.
- name: Get Secrets and Parse JSON
uses: aws-actions/aws-secretsmanager-get-secrets@v3
with:
secret-ids: |
test/secret
,secret2
parse-json-secrets: true