Use SDK with service account
This commit is contained in:
11
src/index.ts
11
src/index.ts
@@ -3,7 +3,7 @@ import * as core from "@actions/core";
|
||||
import { validateCli } from "@1password/op-js";
|
||||
import { installCliOnGithubActionRunner } from "./op-cli-installer";
|
||||
import { loadSecrets, unsetPrevious, validateAuth } from "./utils";
|
||||
import { envFilePath } from "./constants";
|
||||
import { envFilePath, envConnectHost, envConnectToken } from "./constants";
|
||||
|
||||
const loadSecretsAction = async () => {
|
||||
try {
|
||||
@@ -26,8 +26,13 @@ const loadSecretsAction = async () => {
|
||||
dotenv.config({ path: file });
|
||||
}
|
||||
|
||||
// Download and install the CLI
|
||||
await installCLI();
|
||||
|
||||
const isConnect =
|
||||
process.env[envConnectHost] && process.env[envConnectToken];
|
||||
// If Connect is used, download and install the CLI
|
||||
if (isConnect) {
|
||||
await installCLI();
|
||||
}
|
||||
|
||||
// Load secrets
|
||||
await loadSecrets(shouldExportEnv);
|
||||
|
||||
Reference in New Issue
Block a user