From 03d63f77dfa9a46154891836656bbf4430c865f2 Mon Sep 17 00:00:00 2001 From: chunye Date: Mon, 21 Jun 2021 18:24:58 -0700 Subject: [PATCH] Remove windowsContainerAppNotAllowedForPublishProfile validator. --- .../PublishProfileContainerWebAppValidator.js | 1 - lib/ActionInputValidator/Validations.js | 16 ---------------- package.json | 2 +- .../PublishProfileContainerWebAppValidator.ts | 4 +--- src/ActionInputValidator/Validations.ts | 10 ---------- 5 files changed, 2 insertions(+), 31 deletions(-) diff --git a/lib/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.js b/lib/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.js index 0faab10f1..4e6fe27c0 100644 --- a/lib/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.js +++ b/lib/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.js @@ -16,7 +16,6 @@ class PublishProfileContainerWebAppValidator { return __awaiter(this, void 0, void 0, function* () { const actionParams = actionparameters_1.ActionParameters.getActionParams(); Validations_1.packageNotAllowed(actionParams.packageInput); - yield Validations_1.windowsContainerAppNotAllowedForPublishProfile(); Validations_1.multiContainerNotAllowed(actionParams.multiContainerConfigFile); Validations_1.startupCommandNotAllowed(actionParams.startupCommand); Validations_1.validateAppDetails(); diff --git a/lib/ActionInputValidator/Validations.js b/lib/ActionInputValidator/Validations.js index ebd284f3d..786c14337 100644 --- a/lib/ActionInputValidator/Validations.js +++ b/lib/ActionInputValidator/Validations.js @@ -15,14 +15,10 @@ var __importStar = (this && this.__importStar) || function (mod) { result["default"] = mod; return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); const packageUtility_1 = require("azure-actions-utility/packageUtility"); const PublishProfile_1 = require("../Utilities/PublishProfile"); -const RuntimeConstants_1 = __importDefault(require("../RuntimeConstants")); const actionparameters_1 = require("../actionparameters"); const fs = require("fs"); // Error is app-name is not provided @@ -124,15 +120,3 @@ function validatePackageInput() { }); } exports.validatePackageInput = validatePackageInput; -// windows container app not allowed for publish profile auth scheme -function windowsContainerAppNotAllowedForPublishProfile() { - return __awaiter(this, void 0, void 0, function* () { - const actionParams = actionparameters_1.ActionParameters.getActionParams(); - const publishProfile = PublishProfile_1.PublishProfile.getPublishProfile(actionParams.publishProfileContent); - const appOS = yield publishProfile.getAppOS(); - if (appOS.includes(RuntimeConstants_1.default.Windows) || appOS.includes(RuntimeConstants_1.default.Windows.toLowerCase())) { - throw new Error("Publish profile auth scheme is not supported for Windows container Apps."); - } - }); -} -exports.windowsContainerAppNotAllowedForPublishProfile = windowsContainerAppNotAllowedForPublishProfile; diff --git a/package.json b/package.json index b17daf8e2..7e038c9b0 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@actions/core": "^1.2.6", "@actions/github": "^4.0.0", "actions-secret-parser": "^1.0.3", - "azure-actions-appservice-rest": "^1.3.1", + "azure-actions-appservice-rest": "^1.3.3", "azure-actions-utility": "^1.0.3", "azure-actions-webclient": "^1.1.0" } diff --git a/src/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.ts b/src/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.ts index ce2a9be7b..89751daab 100644 --- a/src/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.ts +++ b/src/ActionInputValidator/ActionValidators/PublishProfileContainerWebAppValidator.ts @@ -1,4 +1,4 @@ -import { packageNotAllowed, windowsContainerAppNotAllowedForPublishProfile, multiContainerNotAllowed, startupCommandNotAllowed, validateSingleContainerInputs, validateAppDetails } from "../Validations"; +import { packageNotAllowed, multiContainerNotAllowed, startupCommandNotAllowed, validateSingleContainerInputs, validateAppDetails } from "../Validations"; import { ActionParameters } from "../../actionparameters"; import { IValidator } from "./IValidator"; @@ -7,8 +7,6 @@ export class PublishProfileContainerWebAppValidator implements IValidator { const actionParams: ActionParameters = ActionParameters.getActionParams(); packageNotAllowed(actionParams.packageInput); - - await windowsContainerAppNotAllowedForPublishProfile(); multiContainerNotAllowed(actionParams.multiContainerConfigFile); diff --git a/src/ActionInputValidator/Validations.ts b/src/ActionInputValidator/Validations.ts index e637b620e..750385674 100644 --- a/src/ActionInputValidator/Validations.ts +++ b/src/ActionInputValidator/Validations.ts @@ -109,14 +109,4 @@ export async function validatePackageInput() { if(isMSBuildPackage) { throw new Error(`Deployment of msBuild generated package is not supported. Please change package format.`); } -} - -// windows container app not allowed for publish profile auth scheme -export async function windowsContainerAppNotAllowedForPublishProfile() { - const actionParams = ActionParameters.getActionParams(); - const publishProfile: PublishProfile = PublishProfile.getPublishProfile(actionParams.publishProfileContent); - const appOS: string = await publishProfile.getAppOS(); - if (appOS.includes(RuntimeConstants.Windows) || appOS.includes(RuntimeConstants.Windows.toLowerCase())) { - throw new Error("Publish profile auth scheme is not supported for Windows container Apps."); - } } \ No newline at end of file