Skip to content

Commit d0d3f4a

Browse files
prontclaude
andcommitted
Restore override loading; fix multi-repo workflow regression
Non-override loading broke fetch-all and generate-all: the first env file's REPO_OWNER/REPO_NAME/GITHUB_TOKEN would persist across all subsequent iterations. Explicit --env-file is always authoritative. When using `op run --env-file=<f>`, secrets are resolved to real values before the process starts, so override mode is safe there too. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e42d54a commit d0d3f4a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

scripts/util/load_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def load_env(env_file=ENV_FILE) -> dict:
2626
if not env_file:
2727
raise ValueError(f"No .env file found at {env_file}")
2828

29-
success = load_dotenv(env_file, override=False, verbose=True)
29+
success = load_dotenv(env_file, override=True, verbose=True)
3030
if not success:
3131
raise ValueError(f"Failed to load .env file at: {env_file}")
3232

src/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ impl Config {
2020
impl Config {
2121
pub fn load(env_file: Option<&str>) -> Result<Self> {
2222
if let Some(path) = env_file {
23-
// Non-override: vars already in the environment (e.g. injected by `op run`) take precedence.
24-
dotenvy::from_filename(path)
23+
// Override: an explicit --env-file is authoritative, which is required for
24+
// multi-repo workflows that iterate over several env files in sequence.
25+
// When using `op run --env-file=<f>`, secrets are resolved before this
26+
// process starts, so the file values are already the real ones.
27+
dotenvy::from_filename_override(path)
2528
.with_context(|| format!("Failed to load env file: {path}"))?;
2629
} else {
2730
dotenvy::dotenv().ok();

0 commit comments

Comments
 (0)