Skip to content

Commit

Permalink
exec azpath
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia committed Dec 14, 2023
1 parent 8fd4b86 commit 29ec96c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cleanup.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as io from '@actions/io';

async function cleanup() {
try {
let azPath = await io.which("az", true);
core.info("Clearing accounts from the local cache.")
await exec.exec("az", ["account", "clear"]);
await exec.exec(`"${azPath}"`, ["account", "clear"]);
}
catch (error) {
core.setFailed(`Login cleanup failed with ${error}.`);
Expand Down
2 changes: 1 addition & 1 deletion src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function setup() {
core.debug(`Azure CLI path: ${azPath}`);

core.info("Clearing accounts from the local cache.")
await exec.exec("az", ["account", "clear"]);
await exec.exec(`"${azPath}"`, ["account", "clear"]);
}
catch (error) {
core.setFailed(`Login setup failed with ${error}. Make sure 'az' is installed on the runner.`);
Expand Down

0 comments on commit 29ec96c

Please sign in to comment.