Avoid copying the same environment block.
Section: Real-world reuse patterns
Reuse environment variables
yaml
yaml
env: &common_env
NODE_ENV: production
LOG_LEVEL: info
worker:
env: *common_envExplanation
Anchors make shared environment sections easier to maintain.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Real-world reuse patterns
Catch duplicate mapping keys
Lint for repeated keys that override silently in some parsers.
Merge shared mappings
Combine a base config with environment-specific overrides.