@@ -112,6 +112,16 @@ function Validate-ReviewComments {
112
112
}
113
113
}
114
114
115
+ $crEventType = " automated"
116
+ function ValidateCrEventType {
117
+ param ($crEventTypeVal )
118
+ if ($crEventTypeVal -eq " manual" ){
119
+ return " manual"
120
+ }else {
121
+ return " automated"
122
+ }
123
+ }
124
+
115
125
# Function to display URL using IP address and port
116
126
# Run docker ps -l command and store the output
117
127
function Display-DockerUrl {
@@ -356,6 +366,8 @@ $optional_params_cli = @(
356
366
" static_analysis_tool" ,
357
367
" review_scope" ,
358
368
" exclude_branches" ,
369
+ " exclude_files" ,
370
+ " exclude_draft_pr" ,
359
371
" dependency_check" ,
360
372
" dependency_check.snyk_auth_token" ,
361
373
" cra_version" ,
@@ -364,6 +376,7 @@ $optional_params_cli = @(
364
376
" output_path"
365
377
" git.domain"
366
378
" code_context"
379
+ " cr_event_type"
367
380
)
368
381
369
382
# Parameters that are required/optional in mode server
@@ -381,6 +394,8 @@ $optional_params_server = @(
381
394
" static_analysis_tool" ,
382
395
" review_scope" ,
383
396
" exclude_branches" ,
397
+ " exclude_files" ,
398
+ " exclude_draft_pr" ,
384
399
" dependency_check" ,
385
400
" dependency_check.snyk_auth_token" ,
386
401
" server_port" ,
@@ -389,6 +404,7 @@ $optional_params_server = @(
389
404
" cli_path"
390
405
" git.domain"
391
406
" code_context"
407
+ " cr_event_type"
392
408
)
393
409
394
410
$bee_params = @ (
@@ -457,7 +473,7 @@ foreach ($param in $required_params) {
457
473
foreach ($param in $optional_params ) {
458
474
if ($param -eq " dependency_check.snyk_auth_token" -and $props [" dependency_check" ] -eq " True" ) {
459
475
Ask- For- Param $param $false
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" ) {
476
+ } 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" -and $param -ne " exclude_files " -and $param -ne " exclude_draft_pr " -and $param -ne " cr_event_type " ) {
461
477
Ask- For- Param $param $false
462
478
}
463
479
}
@@ -487,7 +503,11 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
487
503
$scopes = $ ($props [$param ]) -replace ' ,\s*' , ' ,'
488
504
$docker_cmd += " --$param ='[$scopes ]'"
489
505
} elseif ($param -eq " exclude_branches" ) {
490
- $docker_cmd += " --exclude_branches=$ ( $props [$param ]) "
506
+ $docker_cmd += " --exclude_branches='$ ( $props [$param ]) '"
507
+ } elseif ($param -eq " exclude_files" ) {
508
+ $docker_cmd += " --exclude_files='$ ( $props [$param ]) '"
509
+ } elseif ($param -eq " exclude_draft_pr" ) {
510
+ $docker_cmd += " --exclude_draft_pr=$ ( $props [$param ]) "
491
511
} elseif ($param -eq " dependency_check" ) {
492
512
$validated_boolean = Validate- Boolean $props [$param ]
493
513
$docker_cmd += " --dependency_check.enabled=$validated_boolean "
@@ -518,11 +538,14 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
518
538
} elseif ($param -eq " review_comments" ) {
519
539
$review_comments = Validate- ReviewComments $props [$param ]
520
540
$docker_cmd += " --$param =$review_comments "
541
+ } elseif ($param -eq " cr_event_type" ) {
542
+ $crEventType = ValidateCrEventType $props [$param ]
521
543
} else {
522
544
$docker_cmd += " --$param =$ ( $props [$param ]) "
523
545
}
524
546
}
525
547
}
548
+ $docker_cmd += " --cr_event_type=$crEventType "
526
549
527
550
$docker_cmd = $docker_init_cmd + $docker_cmd
528
551
$param_bito_access_key = " bito_cli.bito.access_key"
0 commit comments