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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions internal/digraph/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,9 @@ func buildDotenv(ctx BuildContext, spec *definition, dag *DAG) error {
if err != nil {
continue
}
if err := godotenv.Load(resolvedPath); err != nil {
if err := godotenv.Overload(resolvedPath); err != nil {
return wrapError("dotenv", filePath, fmt.Errorf("failed to load dotenv file %s: %w", filePath, err))
}
// Break after the first successful load.
break
}
}

Expand Down
7 changes: 7 additions & 0 deletions internal/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ func TestIntegration(t *testing.T) {
"OUT1": "hello foo",
},
},
{
name: "DotEnv",
dag: "dotenv.yaml",
expectedOutputs: map[string]any{
"OUT1": "123 abc",
},
},
{
name: "NamedParams",
dag: "named-params.yaml",
Expand Down
7 changes: 7 additions & 0 deletions internal/testdata/integration/dotenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dotenv:
- dotenv1
- dotenv2
steps:
- name: step1
command: echo "${ENV1} ${ENV2}"
output: OUT1 #123 abc
2 changes: 2 additions & 0 deletions internal/testdata/integration/dotenv1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV1=123
ENV2=456
1 change: 1 addition & 0 deletions internal/testdata/integration/dotenv2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENV2=abc
Loading