11const inquirer = require ( 'inquirer' ) . default
22const _ = require ( 'lodash' )
33const debug = require ( 'debug' ) ( 'cli:workflows' )
4- const { updateGithubOrgs, upsertGithubRepositories, runAllTheComplianceChecks, upsertOSSFScorecardAnalysis } = require ( '../workflows' )
4+ const { updateGithubOrgs, upsertGithubRepositories, runAllTheComplianceChecks, runOneComplianceCheck , upsertOSSFScorecardAnalysis } = require ( '../workflows' )
55const { generateStaticReports } = require ( '../reports' )
66const { bulkImport } = require ( '../importers' )
77const { logger } = require ( '../utils' )
8- const bulkImportSchema = require ( '../schemas/bulkImport.json ' )
8+ const { executeOneCheckSchema , executeOptionalProjectSchema , bulkImportSchema } = require ( '../schemas' )
99
1010const commandList = [ {
1111 name : 'update-github-orgs' ,
@@ -28,9 +28,18 @@ const commandList = [{
2828 description : 'Run all the compliance checks for the stored data.' ,
2929 operations : null ,
3030 workflow : runAllTheComplianceChecks
31+ } , {
32+ name : 'run-one-check' ,
33+ isRequiredAdditionalData : true ,
34+ isEnabled : true ,
35+ description : 'Run a specific compliance check for the stored data.' ,
36+ operations : null ,
37+ schema : executeOneCheckSchema ,
38+ workflow : runOneComplianceCheck
3139} , {
3240 name : 'upsert-ossf-scorecard' ,
3341 isRequiredAdditionalData : false ,
42+ schema : executeOptionalProjectSchema ,
3443 isEnabled : false ,
3544 description : 'Upsert the OSSF Scorecard scoring by running and checking every repository in the database.' ,
3645 operations : null ,
@@ -64,13 +73,14 @@ const getWorkflowsDetails = () => {
6473
6574 commandList . forEach ( ( workflow ) => {
6675 const workflowName = _ . kebabCase ( workflow . name )
67- workflowsList . push ( { id : workflowName , description : workflow . description , isEnabled : workflow . isEnabled , isRequiredAdditionalData : workflow . isRequiredAdditionalData , operations : workflow . operations } )
76+ workflowsList . push ( { id : workflowName , description : workflow . description , isEnabled : workflow . isEnabled , isRequiredAdditionalData : workflow . isRequiredAdditionalData , operations : workflow . operations , schema : JSON . stringify ( workflow . schema ) } )
6877 workflows [ workflowName ] = {
6978 description : workflow . description ,
7079 workflow : workflow . workflow ,
7180 isEnabled : workflow . isEnabled ,
7281 isRequiredAdditionalData : workflow . isRequiredAdditionalData ,
73- operations : workflow . operations
82+ operations : workflow . operations ,
83+ schema : JSON . stringify ( workflow . schema )
7484 }
7585 } )
7686
0 commit comments