diff --git a/src/cleanup.ts b/src/cleanup.ts index d31822633..d307920d2 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -10,7 +10,7 @@ async function cleanup() { } } catch (error) { - core.setFailed(`Login cleanup failed with ${error}. Make sure 'az' is installed on the runner. If 'enable-AzPSSession' is true, make sure 'pwsh' is installed on the runner together with Azure PowerShell module.`); + core.warning(`Login cleanup failed with ${error}. Cleanup will be skipped.`); core.debug(error.stack); } } diff --git a/src/common/Utils.ts b/src/common/Utils.ts index 9a2734be8..b8a089d2c 100644 --- a/src/common/Utils.ts +++ b/src/common/Utils.ts @@ -13,9 +13,6 @@ export function setUserAgent(): void { export async function cleanupAzCLIAccounts(): Promise { let azPath = await io.which("az", true); - if (!azPath) { - throw new Error("Azure CLI is not found in the runner."); - } core.debug(`Azure CLI path: ${azPath}`); core.info("Clearing azure cli accounts from the local cache."); await exec.exec(`"${azPath}"`, ["account", "clear"]); @@ -23,9 +20,6 @@ export async function cleanupAzCLIAccounts(): Promise { export async function cleanupAzPSAccounts(): Promise { let psPath: string = await io.which(AzPSConstants.PowerShell_CmdName, true); - if (!psPath) { - throw new Error("PowerShell is not found in the runner."); - } core.debug(`PowerShell path: ${psPath}`); core.debug("Importing Azure PowerShell module."); AzPSUtils.setPSModulePathForGitHubRunner();