Skip to content

Commit d5604b8

Browse files
Update bito-cra.ps1 for exclude branches property
1 parent a48b881 commit d5604b8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cra-scripts/bito-cra.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ $optional_params_cli = @(
355355
"static_analysis",
356356
"static_analysis_tool",
357357
"review_scope",
358+
"exclude_branches",
358359
"dependency_check",
359360
"dependency_check.snyk_auth_token",
360361
"cra_version",
@@ -379,6 +380,7 @@ $optional_params_server = @(
379380
"static_analysis",
380381
"static_analysis_tool",
381382
"review_scope",
383+
"exclude_branches",
382384
"dependency_check",
383385
"dependency_check.snyk_auth_token",
384386
"server_port",
@@ -423,6 +425,7 @@ $mode = "cli"
423425
$param_mode = "mode"
424426
$server_port = "10051"
425427
$param_server_port = "server_port"
428+
$command = "review"
426429
$docker_cmd = ""
427430
# handle if CRA is starting in server mode using start command.
428431
if ($force_mode) {
@@ -454,7 +457,7 @@ foreach ($param in $required_params) {
454457
foreach ($param in $optional_params) {
455458
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
456459
Ask-For-Param $param $false
457-
} elseif ($param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "git.domain" -and $param -ne "review_scope") {
460+
} elseif ($param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches") {
458461
Ask-For-Param $param $false
459462
}
460463
}
@@ -471,7 +474,7 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
471474
} elseif ($param -eq "pr_url") {
472475
$trimmedUrl = $props[$param].Trim()
473476
Validate-Url $trimmedUrl
474-
$docker_cmd += " --$param=$($trimmedUrl) review"
477+
$docker_cmd += " --$param=$($trimmedUrl) --command=$($command) rest"
475478
} elseif ($param -eq "git.provider") {
476479
$validated_gitprovider = Validate-GitProvider $props[$param]
477480
$docker_cmd += " --$param=$validated_gitprovider"
@@ -483,6 +486,8 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
483486
} elseif ($param -eq "review_scope") {
484487
$scopes = $($props[$param]) -replace ',\s*', ','
485488
$docker_cmd += " --$param='[$scopes]'"
489+
} elseif ($param -eq "exclude_branches") {
490+
$docker_cmd += " --exclude_branches=$($props[$param])"
486491
} elseif ($param -eq "dependency_check") {
487492
$validated_boolean = Validate-Boolean $props[$param]
488493
$docker_cmd += " --dependency_check.enabled=$validated_boolean"

0 commit comments

Comments
 (0)