File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import * as z from 'zod'
2
2
3
3
export const SEVERITIES = [ 'critical' , 'high' , 'moderate' , 'low' ] as const
4
4
export const SCOPES = [ 'unknown' , 'runtime' , 'development' ] as const
5
+ export const COMMENT_SUMMARY_OPTIONS = [
6
+ 'always' ,
7
+ 'never' ,
8
+ 'on-failure'
9
+ ] as const
5
10
6
11
export const SeveritySchema = z . enum ( SEVERITIES ) . default ( 'low' )
7
12
@@ -47,7 +52,17 @@ export const ConfigurationOptionsSchema = z
47
52
config_file : z . string ( ) . optional ( ) ,
48
53
base_ref : z . string ( ) . optional ( ) ,
49
54
head_ref : z . string ( ) . optional ( ) ,
50
- comment_summary_in_pr : z . enum ( [ 'always' , 'never' , 'on-failure' ] ) . default ( 'never' ) ,
55
+ comment_summary_in_pr : z
56
+ . union ( [ z . boolean ( ) , z . enum ( COMMENT_SUMMARY_OPTIONS ) ] )
57
+ . default ( 'never' )
58
+ } )
59
+ . transform ( config => {
60
+ if ( config . comment_summary_in_pr === true ) {
61
+ config . comment_summary_in_pr = 'always'
62
+ } else if ( config . comment_summary_in_pr === false ) {
63
+ config . comment_summary_in_pr = 'never'
64
+ }
65
+ return config
51
66
} )
52
67
. superRefine ( ( config , context ) => {
53
68
if ( config . allow_licenses && config . deny_licenses ) {
You can’t perform that action at this time.
0 commit comments