mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
* pre and post cleanup-cli * exec azpath * enable azure powershell part * set user agent * extract utils * divide cleanup * extract azpsconfig class * fix test * move runpsscript * change to AzPSUtils * fix typo
20 lines
676 B
TypeScript
20 lines
676 B
TypeScript
import * as core from '@actions/core';
|
|
import { setUserAgent, cleanupAzCLIAccounts, cleanupAzPSAccounts } from './common/Utils';
|
|
|
|
async function cleanup() {
|
|
try {
|
|
setUserAgent();
|
|
await cleanupAzCLIAccounts();
|
|
if(core.getInput('enable-AzPSSession').toLowerCase() === "true"){
|
|
await cleanupAzPSAccounts();
|
|
}
|
|
}
|
|
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.debug(error.stack);
|
|
}
|
|
}
|
|
|
|
cleanup();
|
|
|