Skip to content

Commit

Permalink
Releases/v2.2.7 (#314)
Browse files Browse the repository at this point in the history
* Trim commit message (#301)

Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain>

* Container Registry changed (#299)

* Update pr_check_windows_container_pubprofile.yml

* Moved the entries to secrets

* Update pr_check_windows_container_pubprofile.yml

* Update pr_check_windows_container_pubprofile.yml

* update azure-actions-appservice-rest version (#295)

* Added node modules and package-lock

* Update pr_check_windows_container_pubprofile.yml

* Update pr_check_windows_container_pubprofile.yml

* Update pr_check_windows_container_pubprofile.yml

* Update pr_check_windows_container_pubprofile.yml

* Update pr_check_windows_container_pubprofile.yml

* Update PR gate workflow file

* Enhance deployment error in case of 403 (#305)

* Enhance deployment error in case of 403

* Update aka.ms link

---------

Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain>

* Release V2.2.7

* Adding lib folder

---------

Co-authored-by: kumaraksh1 <112485097+kumaraksh1@users.noreply.github.com>
Co-authored-by: Akshay Kumar <kumaraksh@DESKTOP-ARQ1NM6.localdomain>
  • Loading branch information
3 people authored Apr 6, 2023
1 parent 43cec19 commit 4ed4d42
Show file tree
Hide file tree
Showing 332 changed files with 32,714 additions and 1,827 deletions.
2 changes: 1 addition & 1 deletion lib/actionparameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ActionParameters {
/**
* Trimming the commit message because it is used as a param in uri of deployment api. And sometimes, it exceeds the max length of http URI.
*/
this._commitMessage = github.context.eventName === 'push' ? github.context.payload.head_commit.message.slice(0, 7000) : "";
this._commitMessage = github.context.eventName === 'push' ? github.context.payload.head_commit.message.slice(0, 1000) : "";
this._endpoint = endpoint;
}
static getActionParams(endpoint) {
Expand Down
147 changes: 77 additions & 70 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,77 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const crypto = __importStar(require("crypto"));
const actionparameters_1 = require("./actionparameters");
const AuthorizerFactory_1 = require("azure-actions-webclient/AuthorizerFactory");
const BaseWebAppDeploymentProvider_1 = require("./DeploymentProvider/Providers/BaseWebAppDeploymentProvider");
const DeploymentProviderFactory_1 = require("./DeploymentProvider/DeploymentProviderFactory");
const ValidatorFactory_1 = require("./ActionInputValidator/ValidatorFactory");
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : "";
function main() {
return __awaiter(this, void 0, void 0, function* () {
let isDeploymentSuccess = true;
try {
// Set user agent variable
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex');
let actionName = 'DeployWebAppToAzure';
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`;
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString);
// Initialize action inputs
let endpoint = !!core.getInput('publish-profile') ? null : yield AuthorizerFactory_1.AuthorizerFactory.getAuthorizer();
actionparameters_1.ActionParameters.getActionParams(endpoint);
let type = null;
if (!!endpoint) {
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN;
}
else {
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.PUBLISHPROFILE;
}
// Validate action inputs
let validator = yield ValidatorFactory_1.ValidatorFactory.getValidator(type);
yield validator.validate();
var deploymentProvider = DeploymentProviderFactory_1.DeploymentProviderFactory.getDeploymentProvider(type);
core.debug("Predeployment Step Started");
yield deploymentProvider.PreDeploymentStep();
core.debug("Deployment Step Started");
yield deploymentProvider.DeployWebAppStep();
}
catch (error) {
isDeploymentSuccess = false;
core.setFailed("Deployment Failed with Error: " + error);
}
finally {
if (deploymentProvider != null) {
yield deploymentProvider.UpdateDeploymentStatus(isDeploymentSuccess);
}
// Reset AZURE_HTTP_USER_AGENT
core.exportVariable('AZURE_HTTP_USER_AGENT', prefix);
core.debug(isDeploymentSuccess ? "Deployment Succeeded" : "Deployment failed");
}
});
}
exports.main = main;
main();
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const crypto = __importStar(require("crypto"));
const actionparameters_1 = require("./actionparameters");
const AuthorizerFactory_1 = require("azure-actions-webclient/AuthorizerFactory");
const BaseWebAppDeploymentProvider_1 = require("./DeploymentProvider/Providers/BaseWebAppDeploymentProvider");
const DeploymentProviderFactory_1 = require("./DeploymentProvider/DeploymentProviderFactory");
const ValidatorFactory_1 = require("./ActionInputValidator/ValidatorFactory");
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : "";
function main() {
return __awaiter(this, void 0, void 0, function* () {
let isDeploymentSuccess = true;
try {
// Set user agent variable
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex');
let actionName = 'DeployWebAppToAzure';
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`;
core.exportVariable('AZURE_HTTP_USER_AGENT', userAgentString);
// Initialize action inputs
let endpoint = !!core.getInput('publish-profile') ? null : yield AuthorizerFactory_1.AuthorizerFactory.getAuthorizer();
actionparameters_1.ActionParameters.getActionParams(endpoint);
let type = null;
if (!!endpoint) {
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN;
}
else {
type = BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.PUBLISHPROFILE;
}
// Validate action inputs
let validator = yield ValidatorFactory_1.ValidatorFactory.getValidator(type);
yield validator.validate();
var deploymentProvider = DeploymentProviderFactory_1.DeploymentProviderFactory.getDeploymentProvider(type);
core.debug("Predeployment Step Started");
yield deploymentProvider.PreDeploymentStep();
core.debug("Deployment Step Started");
yield deploymentProvider.DeployWebAppStep();
}
catch (error) {
isDeploymentSuccess = false;
if (error.statusCode == 403) {
core.setFailed("The deployment to your web app failed with HTTP status code 403. \
Your web app may have networking features enabled which are blocking access (such as Private Endpoints).\
For more information, please follow https://aka.ms/forbidden-deployment-error");
}
else {
core.setFailed("Deployment Failed, " + error);
}
}
finally {
if (deploymentProvider != null) {
yield deploymentProvider.UpdateDeploymentStatus(isDeploymentSuccess);
}
// Reset AZURE_HTTP_USER_AGENT
core.exportVariable('AZURE_HTTP_USER_AGENT', prefix);
core.debug(isDeploymentSuccess ? "Deployment Succeeded" : "Deployment failed");
}
});
}
exports.main = main;
main();
1 change: 1 addition & 0 deletions node_modules/.bin/copy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/copy-cli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ed4d42

Please sign in to comment.