зеркало из https://github.com/Azure/powershell.git
update console.log to core.info (#90)
This commit is contained in:
Родитель
3e549c7159
Коммит
1dcd677e09
14
src/main.ts
14
src/main.ts
|
@ -25,21 +25,21 @@ async function main() {
|
||||||
const errorActionPreference: string = core.getInput('errorActionPreference');
|
const errorActionPreference: string = core.getInput('errorActionPreference');
|
||||||
const failOnStandardError = core.getInput('failOnStandardError').trim().toLowerCase() === "true";
|
const failOnStandardError = core.getInput('failOnStandardError').trim().toLowerCase() === "true";
|
||||||
const githubToken = core.getInput('githubToken');
|
const githubToken = core.getInput('githubToken');
|
||||||
console.log(`Validating inputs`);
|
core.info(`Validating inputs`);
|
||||||
validateInputs(inlineScript, errorActionPreference);
|
validateInputs(inlineScript, errorActionPreference);
|
||||||
|
|
||||||
const githubAuth = !githubToken || Utils.isGhes() ? undefined : `token ${githubToken}`;
|
const githubAuth = !githubToken || Utils.isGhes() ? undefined : `token ${githubToken}`;
|
||||||
const installResult = await new AzModuleInstaller(azPSVersion, githubAuth).install();
|
const installResult = await new AzModuleInstaller(azPSVersion, githubAuth).install();
|
||||||
console.log(`Module Az ${azPSVersion} installed from ${installResult.moduleSource}`);
|
core.info(`Module Az ${azPSVersion} installed from ${installResult.moduleSource}`);
|
||||||
|
|
||||||
console.log(`Initializing Az Module`);
|
core.info(`Initializing Az Module`);
|
||||||
await InitializeAzure.importAzModule(azPSVersion);
|
await InitializeAzure.importAzModule(azPSVersion);
|
||||||
console.log(`Initializing Az Module Complete`);
|
core.info(`Initializing Az Module Complete`);
|
||||||
|
|
||||||
console.log(`Running Az PowerShell Script`);
|
core.info(`Running Az PowerShell Script`);
|
||||||
const scriptRunner: ScriptRunner = new ScriptRunner(inlineScript, errorActionPreference, failOnStandardError);
|
const scriptRunner: ScriptRunner = new ScriptRunner(inlineScript, errorActionPreference, failOnStandardError);
|
||||||
await scriptRunner.executeFile();
|
await scriptRunner.executeFile();
|
||||||
console.log(`Script execution Complete`);
|
core.info(`Script execution Complete`);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
core.setFailed(error);
|
core.setFailed(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -56,7 +56,7 @@ function validateInputs(inlineScript: string, errorActionPreference: string) {
|
||||||
}
|
}
|
||||||
if (azPSVersion !== "latest") {
|
if (azPSVersion !== "latest") {
|
||||||
if (!Utils.isValidVersion(azPSVersion)) {
|
if (!Utils.isValidVersion(azPSVersion)) {
|
||||||
console.log(`Invalid azPSVersion : ${azPSVersion}. Using latest Az Module version.`);
|
core.info(`Invalid azPSVersion : ${azPSVersion}. Using latest Az Module version.`);
|
||||||
azPSVersion = 'latest';
|
azPSVersion = 'latest';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче