@@ -10,9 +10,9 @@ const { socketYmlSchemaV1 } = require('./lib/v1')
1010
1111/**
1212 * @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
1616 */
1717
1818/**
@@ -43,13 +43,13 @@ const socketYmlSchema = {
4343 githubApp : {
4444 type : 'object' ,
4545 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 } ,
4949 } ,
5050 required : [ ] ,
5151 additionalProperties : false ,
52- default : { enabled : true , projectReportsEnabled : true , pullRequestAlertsEnabled : true }
52+ default : { }
5353 } ,
5454 } ,
5555 required : [ 'version' ] ,
@@ -180,11 +180,12 @@ async function parseV1SocketConfig (parsedV1Content) {
180180 projectIgnorePaths : parsedV1Content ?. ignore ?? [ ] ,
181181 issueRules : parsedV1Content ?. issues ?? { } ,
182182 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 } : { } ) ,
186186 }
187187 }
188+
188189 return v2
189190}
190191
0 commit comments