@@ -10,9 +10,9 @@ const { socketYmlSchemaV1 } = require('./lib/v1')
10
10
11
11
/**
12
12
* @typedef SocketYmlGitHub
13
- * @property {boolean } enabled enable/disable the Socket.dev GitHub app entirely
14
- * @property {boolean } projectReportsEnabled enable/disable Github app project report checks
15
- * @property {boolean } pullRequestAlertsEnabled enable/disable GitHub app pull request alert checks
13
+ * @property {boolean } [ enabled] enable/disable the Socket.dev GitHub app entirely
14
+ * @property {boolean } [ projectReportsEnabled] enable/disable Github app project report checks
15
+ * @property {boolean } [ pullRequestAlertsEnabled] enable/disable GitHub app pull request alert checks
16
16
*/
17
17
18
18
/**
@@ -43,13 +43,13 @@ const socketYmlSchema = {
43
43
githubApp : {
44
44
type : 'object' ,
45
45
properties : {
46
- enabled : { type : 'boolean' , default : true } ,
47
- projectReportsEnabled : { type : 'boolean' , default : true } ,
48
- pullRequestAlertsEnabled : { type : 'boolean' , default : true } ,
46
+ enabled : { type : 'boolean' , nullable : true } ,
47
+ projectReportsEnabled : { type : 'boolean' , nullable : true } ,
48
+ pullRequestAlertsEnabled : { type : 'boolean' , nullable : true } ,
49
49
} ,
50
50
required : [ ] ,
51
51
additionalProperties : false ,
52
- default : { enabled : true , projectReportsEnabled : true , pullRequestAlertsEnabled : true }
52
+ default : { }
53
53
} ,
54
54
} ,
55
55
required : [ 'version' ] ,
@@ -180,11 +180,12 @@ async function parseV1SocketConfig (parsedV1Content) {
180
180
projectIgnorePaths : parsedV1Content ?. ignore ?? [ ] ,
181
181
issueRules : parsedV1Content ?. issues ?? { } ,
182
182
githubApp : {
183
- enabled : Boolean ( parsedV1Content ? .enabled ) ,
184
- pullRequestAlertsEnabled : Boolean ( parsedV1Content ? .pullRequestAlertsEnabled ) ,
185
- projectReportsEnabled : Boolean ( parsedV1Content ? .projectReportsEnabled )
183
+ ... ( ' enabled' in parsedV1Content ? { enabled : parsedV1Content . enabled } : { } ) ,
184
+ ... ( ' pullRequestAlertsEnabled' in parsedV1Content ? { pullRequestAlertsEnabled : parsedV1Content . pullRequestAlertsEnabled } : { } ) ,
185
+ ... ( ' projectReportsEnabled' in parsedV1Content ? { projectReportsEnabled : parsedV1Content . projectReportsEnabled } : { } ) ,
186
186
}
187
187
}
188
+
188
189
return v2
189
190
}
190
191
0 commit comments