mirror of
https://github.com/azure/login.git
synced 2026-06-07 06:17:08 +00:00
addressed review comments
This commit is contained in:
parent
072c92e926
commit
fb74babeb9
2 changed files with 16 additions and 16 deletions
16
lib/main.js
16
lib/main.js
|
|
@ -37,14 +37,14 @@ function main() {
|
|||
core.exportVariable('AZUREPS_HOST_ENVIRONMENT', azurePSHostEnv);
|
||||
azPath = yield io.which("az", true);
|
||||
let output = "";
|
||||
const options = {
|
||||
const execOptions = {
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
output += data.toString();
|
||||
}
|
||||
}
|
||||
};
|
||||
yield executeAzCliCommand("--version", true, options);
|
||||
yield executeAzCliCommand("--version", true, execOptions);
|
||||
core.debug(`az cli version used:\n${output}`);
|
||||
let creds = core.getInput('creds', { required: true });
|
||||
let secrets = new actions_secret_parser_1.SecretParser(creds, actions_secret_parser_1.FormatType.JSON);
|
||||
|
|
@ -62,28 +62,28 @@ function main() {
|
|||
}
|
||||
// Attempting Az cli login
|
||||
if (allowNoSubscriptionsLogin) {
|
||||
let parameters = [
|
||||
let args = [
|
||||
"--allow-no-subscriptions",
|
||||
"--service-principal",
|
||||
"-u", servicePrincipalId,
|
||||
"-p", servicePrincipalKey,
|
||||
"--tenant", tenantId
|
||||
];
|
||||
yield executeAzCliCommand(`login`, true, {}, parameters);
|
||||
yield executeAzCliCommand(`login`, true, {}, args);
|
||||
}
|
||||
else {
|
||||
let parameters = [
|
||||
let args = [
|
||||
"--service-principal",
|
||||
"-u", servicePrincipalId,
|
||||
"-p", servicePrincipalKey,
|
||||
"--tenant", tenantId
|
||||
];
|
||||
yield executeAzCliCommand(`login`, true, {}, parameters);
|
||||
parameters = [
|
||||
yield executeAzCliCommand(`login`, true, {}, args);
|
||||
args = [
|
||||
"--subscription",
|
||||
subscriptionId
|
||||
];
|
||||
yield executeAzCliCommand(`account set`, true, {}, parameters);
|
||||
yield executeAzCliCommand(`account set`, true, {}, args);
|
||||
}
|
||||
isAzCLISuccess = true;
|
||||
if (enableAzPSSession) {
|
||||
|
|
|
|||
16
src/main.ts
16
src/main.ts
|
|
@ -22,14 +22,14 @@ async function main() {
|
|||
|
||||
azPath = await io.which("az", true);
|
||||
let output: string = "";
|
||||
const options: any = {
|
||||
const execOptions: any = {
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
output += data.toString();
|
||||
}
|
||||
}
|
||||
};
|
||||
await executeAzCliCommand("--version", true, options);
|
||||
await executeAzCliCommand("--version", true, execOptions);
|
||||
core.debug(`az cli version used:\n${output}`);
|
||||
|
||||
let creds = core.getInput('creds', { required: true });
|
||||
|
|
@ -50,28 +50,28 @@ async function main() {
|
|||
|
||||
// Attempting Az cli login
|
||||
if (allowNoSubscriptionsLogin) {
|
||||
let parameters = [
|
||||
let args = [
|
||||
"--allow-no-subscriptions",
|
||||
"--service-principal",
|
||||
"-u", servicePrincipalId,
|
||||
"-p", servicePrincipalKey,
|
||||
"--tenant", tenantId
|
||||
];
|
||||
await executeAzCliCommand(`login`, true, {}, parameters);
|
||||
await executeAzCliCommand(`login`, true, {}, args);
|
||||
}
|
||||
else {
|
||||
let parameters = [
|
||||
let args = [
|
||||
"--service-principal",
|
||||
"-u", servicePrincipalId,
|
||||
"-p", servicePrincipalKey,
|
||||
"--tenant", tenantId
|
||||
];
|
||||
await executeAzCliCommand(`login`, true, {}, parameters);
|
||||
parameters = [
|
||||
await executeAzCliCommand(`login`, true, {}, args);
|
||||
args = [
|
||||
"--subscription",
|
||||
subscriptionId
|
||||
];
|
||||
await executeAzCliCommand(`account set`, true, {}, parameters);
|
||||
await executeAzCliCommand(`account set`, true, {}, args);
|
||||
}
|
||||
isAzCLISuccess = true;
|
||||
if (enableAzPSSession) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue