mirror of
https://github.com/azure/login.git
synced 2026-06-08 01:47:21 +00:00
changes from arary to set
This commit is contained in:
parent
e22df6b974
commit
ab062435f9
2 changed files with 4 additions and 4 deletions
|
|
@ -50,7 +50,7 @@ function main() {
|
|||
core.exportVariable('AZUREPS_HOST_ENVIRONMENT', azurePSHostEnv);
|
||||
azPath = yield io.which("az", true);
|
||||
yield executeAzCliCommand("--version");
|
||||
let azureSupportedCloudName = ["azureusgovernment", "azurechinacloud", "azuregermancloud", "azurecloud", "azurestack"];
|
||||
let azureSupportedCloudName = new Set(["azureusgovernment", "azurechinacloud", "azuregermancloud", "azurecloud", "azurestack"]);
|
||||
let creds = core.getInput('creds', { required: true });
|
||||
let secrets = new actions_secret_parser_1.SecretParser(creds, actions_secret_parser_1.FormatType.JSON);
|
||||
let servicePrincipalId = secrets.getSecret("$.clientId", false);
|
||||
|
|
@ -64,7 +64,7 @@ function main() {
|
|||
if (!servicePrincipalId || !servicePrincipalKey || !tenantId || !subscriptionId) {
|
||||
throw new Error("Not all values are present in the creds object. Ensure clientId, clientSecret, tenantId and subscriptionId are supplied.");
|
||||
}
|
||||
if (!azureSupportedCloudName.includes(environment)) {
|
||||
if (!azureSupportedCloudName.has(environment)) {
|
||||
throw new Error("Unsupported value for environment is passed.The list of supported values for environment are ‘azureusgovernment', ‘azurechinacloud’, ‘azuregermancloud’, ‘azurecloud’ or ’azurestack’");
|
||||
}
|
||||
// Attempting Az cli login
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ async function main() {
|
|||
azPath = await io.which("az", true);
|
||||
await executeAzCliCommand("--version");
|
||||
|
||||
let azureSupportedCloudName:string[] = ["azureusgovernment", "azurechinacloud", "azuregermancloud","azurecloud","azurestack"];
|
||||
let azureSupportedCloudName = new Set(["azureusgovernment", "azurechinacloud", "azuregermancloud","azurecloud","azurestack"]);
|
||||
let creds = core.getInput('creds', { required: true });
|
||||
let secrets = new SecretParser(creds, FormatType.JSON);
|
||||
let servicePrincipalId = secrets.getSecret("$.clientId", false);
|
||||
|
|
@ -39,7 +39,7 @@ async function main() {
|
|||
throw new Error("Not all values are present in the creds object. Ensure clientId, clientSecret, tenantId and subscriptionId are supplied.");
|
||||
}
|
||||
|
||||
if(!azureSupportedCloudName.includes(environment)){
|
||||
if(!azureSupportedCloudName.has(environment)){
|
||||
throw new Error("Unsupported value for environment is passed.The list of supported values for environment are ‘azureusgovernment', ‘azurechinacloud’, ‘azuregermancloud’, ‘azurecloud’ or ’azurestack’");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue