Fix linting issues
This commit is contained in:
@@ -26,7 +26,6 @@ const loadSecretsAction = async () => {
|
|||||||
dotenv.config({ path: file });
|
dotenv.config({ path: file });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const isConnect =
|
const isConnect =
|
||||||
process.env[envConnectHost] && process.env[envConnectToken];
|
process.env[envConnectHost] && process.env[envConnectToken];
|
||||||
// If Connect is used, download and install the CLI
|
// If Connect is used, download and install the CLI
|
||||||
|
|||||||
@@ -210,7 +210,6 @@ describe("loadSecrets when using Service Account", () => {
|
|||||||
mockResolve.mockResolvedValue("resolved-secret-value");
|
mockResolve.mockResolvedValue("resolved-secret-value");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("does not call op env ls when using Service Account", async () => {
|
it("does not call op env ls when using Service Account", async () => {
|
||||||
await loadSecrets(false);
|
await loadSecrets(false);
|
||||||
expect(exec.getExecOutput).not.toHaveBeenCalled();
|
expect(exec.getExecOutput).not.toHaveBeenCalled();
|
||||||
@@ -219,7 +218,10 @@ describe("loadSecrets when using Service Account", () => {
|
|||||||
it("sets step output with resolved value when export-env is false", async () => {
|
it("sets step output with resolved value when export-env is false", async () => {
|
||||||
await loadSecrets(false);
|
await loadSecrets(false);
|
||||||
expect(core.setOutput).toHaveBeenCalledTimes(1);
|
expect(core.setOutput).toHaveBeenCalledTimes(1);
|
||||||
expect(core.setOutput).toHaveBeenCalledWith("MY_SECRET", "resolved-secret-value");
|
expect(core.setOutput).toHaveBeenCalledWith(
|
||||||
|
"MY_SECRET",
|
||||||
|
"resolved-secret-value",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("masks secret with setSecret when export-env is false", async () => {
|
it("masks secret with setSecret when export-env is false", async () => {
|
||||||
@@ -247,7 +249,10 @@ describe("loadSecrets when using Service Account", () => {
|
|||||||
|
|
||||||
it("does not set step output when export-env is true", async () => {
|
it("does not set step output when export-env is true", async () => {
|
||||||
await loadSecrets(true);
|
await loadSecrets(true);
|
||||||
expect(core.setOutput).not.toHaveBeenCalledWith("MY_SECRET", expect.anything());
|
expect(core.setOutput).not.toHaveBeenCalledWith(
|
||||||
|
"MY_SECRET",
|
||||||
|
expect.anything(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("masks secret with setSecret when export-env is true", async () => {
|
it("masks secret with setSecret when export-env is true", async () => {
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ const loadSecretsViaServiceAccount = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const loadSecrets = async (shouldExportEnv: boolean): Promise<void> => {
|
export const loadSecrets = async (shouldExportEnv: boolean): Promise<void> => {
|
||||||
const isConnect =
|
const isConnect = process.env[envConnectHost] && process.env[envConnectToken];
|
||||||
process.env[envConnectHost] && process.env[envConnectToken];
|
|
||||||
|
|
||||||
if (isConnect) {
|
if (isConnect) {
|
||||||
await loadSecretsViaConnect(shouldExportEnv);
|
await loadSecretsViaConnect(shouldExportEnv);
|
||||||
|
|||||||
Reference in New Issue
Block a user