Skip to content

Commit

Permalink
Add skipFirewallCheck to IActionInputs
Browse files Browse the repository at this point in the history
  • Loading branch information
zijchen committed Jun 26, 2024
1 parent e928598 commit 6b02c1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/AzureSqlAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface IActionInputs {
connectionConfig: SqlConnectionConfig;
filePath: string;
additionalArguments?: string;
skipFirewallCheck: boolean;
}

export interface IDacpacActionInputs extends IActionInputs {
Expand Down
13 changes: 7 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function run() {
const azureSqlAction = new AzureSqlAction(inputs);

// Unless skip-firewall-check is set to true, check if the runner's IP address is allowed to connect to the server
if (core.getBooleanInput('skip-firewall-check') !== true) {
if (inputs.skipFirewallCheck !== true) {
const runnerIPAddress = await SqlUtils.detectIPAddress(inputs.connectionConfig);
if (runnerIPAddress) {
let azureResourceAuthorizer = await AuthorizerFactory.getAuthorizer();
Expand Down Expand Up @@ -75,7 +75,8 @@ function getInputs(): IActionInputs {
actionType: ActionType.SqlAction,
connectionConfig: connectionConfig,
filePath: filePath,
additionalArguments: core.getInput('arguments') || undefined
additionalArguments: core.getInput('arguments') || undefined,
skipFirewallCheck: core.getBooleanInput('skip-firewall-check')
};

case Constants.dacpacExtension:
Expand All @@ -88,7 +89,8 @@ function getInputs(): IActionInputs {
connectionConfig: connectionConfig,
filePath: filePath,
sqlpackageAction: AzureSqlActionHelper.getSqlpackageActionTypeFromString(action),
additionalArguments: core.getInput('arguments') || undefined
additionalArguments: core.getInput('arguments') || undefined,
skipFirewallCheck: core.getBooleanInput('skip-firewall-check')
} as IDacpacActionInputs;

case Constants.sqlprojExtension:
Expand All @@ -102,11 +104,10 @@ function getInputs(): IActionInputs {
filePath: filePath,
buildArguments: core.getInput('build-arguments') || undefined,
sqlpackageAction: AzureSqlActionHelper.getSqlpackageActionTypeFromString(action),
additionalArguments: core.getInput('arguments') || undefined
additionalArguments: core.getInput('arguments') || undefined,
skipFirewallCheck: core.getBooleanInput('skip-firewall-check')
} as IBuildAndPublishInputs;

break;

default:
throw new Error(`Invalid file type provided as input ${filePath}. File must be a .sql, .dacpac, or .sqlproj file.`)
}
Expand Down

0 comments on commit 6b02c1f

Please sign in to comment.