Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@xpepper
Copy link
Owner

@xpepper xpepper commented Jul 11, 2025

Add env_file configuration option to load environment variables from a file

This PR adds a new env_file configuration option that allows loading multiple environment variables from a file, providing an alternative to specifying them individually with the existing env option.

Features

  • File-based environment loading: Use env_file = "./.env" to load variables from a file
  • Standard .env format support: Supports KEY=VALUE format with comments and quoted values
  • Flexible configuration: Can be set globally or per-job
  • Proper priority handling: Direct env variables override env_file variables
  • Relative path resolution: Paths are resolved relative to the package directory
  • Graceful error handling: Missing files generate warnings but don't fail the build

Usage Examples

Global environment file:

# bacon.toml
env_file = "./.env"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants