File tree 4 files changed +8
-2
lines changed
4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ async function runCheckCommand (knex, options = {}) {
40
40
41
41
debug ( 'Running check with code_name:' , answers . name )
42
42
await checks [ answers . name ] ( knex )
43
+ logger . info ( `Check (${ answers . name } ) ran successfully` )
43
44
}
44
45
45
46
module . exports = {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const { stringToArray } = require('@ulisesgascon/string-to-array')
3
3
const isSlug = require ( 'validator/lib/isSlug.js' )
4
4
const debug = require ( 'debug' ) ( 'cli' )
5
5
const { getConfig } = require ( '../config' )
6
- const { validateGithubUrl } = require ( '../utils' )
6
+ const { validateGithubUrl, logger } = require ( '../utils' )
7
7
const { initializeStore } = require ( '../store' )
8
8
9
9
const { projectCategories } = getConfig ( )
@@ -102,6 +102,7 @@ async function runAddProjectCommand (knex, options = {}) {
102
102
} ) ) )
103
103
104
104
debug ( `All orgs were stored and linked to (${ answers . name } ) added successfully!` )
105
+ logger . info ( `Project (${ answers . name } ) added successfully!` )
105
106
106
107
return answers
107
108
}
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const performScorecardAnalysis = async (repo) => {
65
65
const start = new Date ( ) . getTime ( )
66
66
const { stdout, stderr } = await exec ( `docker run -e GITHUB_AUTH_TOKEN=${ process . env . GITHUB_TOKEN } --rm ${ ossfScorecardSettings . dockerImage } --repo=${ repo . html_url } --show-details --format=json` )
67
67
if ( stderr ) {
68
- throw new Error ( `Error running OSSF Scorecard for repository (${ repo . full_name } )` )
68
+ throw new Error ( `Error running analysis with OSSF Scorecard for repository (${ repo . full_name } ): ${ stderr } ` )
69
69
}
70
70
const data = JSON . parse ( stdout )
71
71
const end = new Date ( ) . getTime ( )
Original file line number Diff line number Diff line change @@ -40,11 +40,13 @@ const upsertGithubRepositories = async (knex) => {
40
40
41
41
await Promise . all ( organizations . map ( async ( org ) => {
42
42
debug ( `Fetching repositories for org (${ org . login } )` )
43
+ logger . info ( `Fetching repositories for org (${ org . login } )` )
43
44
const repoList = await github . fetchOrgReposListByLogin ( org . login )
44
45
debug ( `Got ${ repoList . length } repositories for org (${ org . login } )` )
45
46
debug ( 'Validating data' )
46
47
validateGithubListOrgRepos ( repoList )
47
48
debug ( `Enriching all repositories for org (${ org . login } )` )
49
+ logger . info ( `Enriching all repositories for org (${ org . login } )` )
48
50
49
51
// Enrich and upsert each repository in parallel
50
52
await Promise . all ( repoList . map ( async ( repo ) => {
@@ -58,6 +60,7 @@ const upsertGithubRepositories = async (knex) => {
58
60
await upsertGithubRepository ( mappedData , org . id )
59
61
} ) )
60
62
} ) )
63
+ logger . info ( 'GitHub repositories updated successfully' )
61
64
}
62
65
63
66
const runAllTheComplianceChecks = async ( knex ) => {
@@ -98,6 +101,7 @@ const upsertOSSFScorecardAnalysis = async (knex) => {
98
101
await upsertOSSFScorecard ( { ...mappedData , github_repository_id : repo . id } )
99
102
} catch ( error ) {
100
103
logger . warn ( `Error running OSSF Scorecard for repository (${ repo . full_name } ). Skipping...` )
104
+ logger . warn ( error . message )
101
105
}
102
106
} ) )
103
107
}
You can’t perform that action at this time.
0 commit comments