mirror of
https://github.com/azure/login.git
synced 2026-03-12 18:07:08 -04:00
move pre cleanup to main and add pre-if and post-if (#484)
This commit is contained in:
@@ -39,6 +39,6 @@ branding:
|
|||||||
color: 'blue'
|
color: 'blue'
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
pre: 'lib/cleanup/index.js'
|
|
||||||
main: 'lib/main/index.js'
|
main: 'lib/main/index.js'
|
||||||
|
post-if: (!env.AZURE_LOGIN_POST_CLEANUP || env.AZURE_LOGIN_POST_CLEANUP != 'false')
|
||||||
post: 'lib/cleanup/index.js'
|
post: 'lib/cleanup/index.js'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { setUserAgent } from './common/Utils';
|
import { cleanupAzCLIAccounts, cleanupAzPSAccounts, setUserAgent } from './common/Utils';
|
||||||
import { AzPSLogin } from './PowerShell/AzPSLogin';
|
import { AzPSLogin } from './PowerShell/AzPSLogin';
|
||||||
import { LoginConfig } from './common/LoginConfig';
|
import { LoginConfig } from './common/LoginConfig';
|
||||||
import { AzureCliLogin } from './Cli/AzureCliLogin';
|
import { AzureCliLogin } from './Cli/AzureCliLogin';
|
||||||
@@ -7,6 +7,13 @@ import { AzureCliLogin } from './Cli/AzureCliLogin';
|
|||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
setUserAgent();
|
setUserAgent();
|
||||||
|
const preCleanup: string = process.env.AZURE_LOGIN_PRE_CLEANUP;
|
||||||
|
if ('true' == preCleanup) {
|
||||||
|
await cleanupAzCLIAccounts();
|
||||||
|
if (core.getInput('enable-AzPSSession').toLowerCase() === "true") {
|
||||||
|
await cleanupAzPSAccounts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// prepare the login configuration
|
// prepare the login configuration
|
||||||
var loginConfig = new LoginConfig();
|
var loginConfig = new LoginConfig();
|
||||||
|
|||||||
Reference in New Issue
Block a user