Skip to content

Commit

Permalink
Adding Resource Group As Optional Param (#283)
Browse files Browse the repository at this point in the history
* Adding Resource Group As Optional Param

* changed the appservice web client version
  • Loading branch information
shpraka authored Jan 11, 2023
1 parent 1217efd commit 3bd04a7
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
startup-command:
description: 'Enter the start up command. For ex. dotnet run or dotnet run'
required: false
resource-group-name:
description: 'Enter the resource group name of the web app'
required: false

outputs:
webapp-url:
description: 'URL to work with your webapp'
Expand Down
2 changes: 1 addition & 1 deletion lib/ActionInputValidator/ValidatorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ValidatorFactory {
}
static getResourceDetails(params) {
return __awaiter(this, void 0, void 0, function* () {
let appDetails = yield AzureResourceFilterUtility_1.AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName);
let appDetails = yield AzureResourceFilterUtility_1.AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName, params.resourceGroupName);
params.resourceGroupName = appDetails["resourceGroupName"];
params.realKind = appDetails["kind"];
params.kind = actionparameters_1.appKindMap.get(params.realKind);
Expand Down
4 changes: 3 additions & 1 deletion lib/actionparameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ exports.appKindMap = new Map([
['app', WebAppKind.Windows],
['app,linux', WebAppKind.Linux],
['app,container,windows', WebAppKind.WindowsContainer],
['app,linux,container', WebAppKind.LinuxContainer]
['app,linux,container', WebAppKind.LinuxContainer],
['api', WebAppKind.Windows],
]);
class ActionParameters {
constructor(endpoint) {
Expand All @@ -32,6 +33,7 @@ class ActionParameters {
this._images = core.getInput('images');
this._multiContainerConfigFile = core.getInput('configuration-file');
this._startupCommand = core.getInput('startup-command');
this._resourceGroupName = core.getInput('resource-group-name');
/**
* 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.
*/
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@actions/core": "^1.10.0",
"@actions/github": "^4.0.0",
"actions-secret-parser": "^1.0.4",
"azure-actions-appservice-rest": "^1.3.3",
"azure-actions-appservice-rest": "^1.3.6",
"azure-actions-utility": "^1.0.3",
"azure-actions-webclient": "^1.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion src/ActionInputValidator/ValidatorFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ValidatorFactory {
}

private static async getResourceDetails(params: ActionParameters) {
let appDetails = await AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName);
let appDetails = await AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName, params.resourceGroupName);
params.resourceGroupName = appDetails["resourceGroupName"];
params.realKind = appDetails["kind"];
params.kind = appKindMap.get(params.realKind);
Expand Down
1 change: 1 addition & 0 deletions src/actionparameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class ActionParameters {
this._images = core.getInput('images');
this._multiContainerConfigFile = core.getInput('configuration-file');
this._startupCommand = core.getInput('startup-command');
this._resourceGroupName = core.getInput('resource-group-name');
/**
* 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.
*/
Expand Down

0 comments on commit 3bd04a7

Please sign in to comment.