Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
reporting

# Logs
logs
*.log
Expand Down
9 changes: 9 additions & 0 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ async function run () {

// Save changes
core.info('Saving changes to database and report')
// check if the directory exists, if not create it
const reportDirectory = reportPath.split('/').slice(0, -1).join('/')
await stat(reportDirectory).catch(() => exec.exec(`mkdir -p ${reportDirectory}`))

await writeFile(databasePath, JSON.stringify(newDatabaseState, null, 2))
await writeFile(reportPath, reportTagsEnabled
? updateOrCreateSegment({
Expand All @@ -115,6 +119,11 @@ async function run () {

if (discoveryEnabled) {
core.info('Saving changes to scope...')

// check if the directory exists, if not create it
const scopetDirectory = scopePath.split('/').slice(0, -1).join('/')
await stat(scopeDirectory).catch(() => exec.exec(`mkdir -p ${scopeDirectory}`))

await writeFile(scopePath, JSON.stringify(scope, null, 2))
}

Expand Down