@@ -27793,7 +27793,7 @@ module.exports = {
2779327793const got = __nccwpck_require__(3061)
2779427794const core = __nccwpck_require__(2186)
2779527795const ejs = __nccwpck_require__(8431)
27796- const { readFile } = (__nccwpck_require__(7147).promises)
27796+ const { readFile, existsSync, mkdirSync } = (__nccwpck_require__(7147).promises)
2779727797const { join } = __nccwpck_require__(1017)
2779827798const { softAssign } = __nccwpck_require__(7348)
2779927799const databaseSchema = __nccwpck_require__(5324)
@@ -27850,14 +27850,24 @@ const generateIssueContent = async (scores, renderBadge) => {
2785027850 return ejs.render(template, { scores: scoresInScope, renderBadge })
2785127851}
2785227852
27853+ const makeDirectory = ({ path }) => {
27854+ const directories = path.split('/').slice(0, -1).join('/')
27855+ core.debug(`Making directory ${directories}`)
27856+ if (!existsSync(directories)) {
27857+ core.debug('Making directory: ', path)
27858+ mkdirSync(directories, { recursive: true })
27859+ }
27860+ }
27861+
2785327862module.exports = {
2785427863 validateDatabaseIntegrity: validateAgainstSchema(databaseSchema, 'database'),
2785527864 validateScopeIntegrity: validateAgainstSchema(scopeSchema, 'scope'),
2785627865 getProjectScore,
2785727866 saveScore,
2785827867 getScore,
2785927868 generateReportContent,
27860- generateIssueContent
27869+ generateIssueContent,
27870+ makeDirectory
2786127871}
2786227872
2786327873
@@ -28137,7 +28147,7 @@ const { readFile, writeFile, stat } = (__nccwpck_require__(7147).promises)
2813728147const { isDifferent } = __nccwpck_require__(9497)
2813828148const { updateOrCreateSegment } = __nccwpck_require__(7794)
2813928149const { generateScores, generateScope } = __nccwpck_require__(4351)
28140- const { validateDatabaseIntegrity, validateScopeIntegrity } = __nccwpck_require__(1608)
28150+ const { validateDatabaseIntegrity, validateScopeIntegrity, makeDirectory } = __nccwpck_require__(1608)
2814128151
2814228152async function run () {
2814328153 let octokit
@@ -28234,6 +28244,8 @@ async function run () {
2823428244
2823528245 // Save changes
2823628246 core.info('Saving changes to database and report')
28247+ console.log('Saving changes to database and report')
28248+ makeDirectory(reportPath)
2823728249 await writeFile(databasePath, JSON.stringify(newDatabaseState, null, 2))
2823828250 await writeFile(reportPath, reportTagsEnabled
2823928251 ? updateOrCreateSegment({
@@ -28246,6 +28258,7 @@ async function run () {
2824628258
2824728259 if (discoveryEnabled) {
2824828260 core.info('Saving changes to scope...')
28261+ makeDirectory(scopePath)
2824928262 await writeFile(scopePath, JSON.stringify(scope, null, 2))
2825028263 }
2825128264
0 commit comments