Skip to content

Commit 0ff92dd

Browse files
committed
Using dotenv package instead of experimental API process.loadEnvFile
Signed-off-by: Willi Carlsen <[email protected]>
1 parent 1850a6b commit 0ff92dd

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@1password/op-js": "^0.1.11",
4444
"@actions/core": "^1.10.1",
4545
"@actions/exec": "^1.1.1",
46+
"dotenv": "^17.2.2",
4647
"op-cli-installer": "github:1Password/op-cli-installer#e6c1c758bc3339e5fe9b06255728039f688f73fa"
4748
},
4849
"devDependencies": {

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from "@actions/core";
22
import { validateCli } from "@1password/op-js";
33
import { installCliOnGithubActionRunner } from "op-cli-installer";
4+
import dotenv from "dotenv";
45
import { loadSecrets, unsetPrevious, validateAuth } from "./utils";
56
import { envFilePath } from "./constants";
67

@@ -22,7 +23,7 @@ const loadSecretsAction = async () => {
2223
const file = process.env[envFilePath];
2324
if (file) {
2425
core.info(`Loading environment variables from file: ${file}`);
25-
process.loadEnvFile(file);
26+
dotenv.config({ path: file });
2627
}
2728

2829
// Download and install the CLI

0 commit comments

Comments
 (0)