Skip to content

Commit

Permalink
run cleanup before folder listing (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrybyk authored Feb 8, 2024
1 parent da3bccb commit 8227e48
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 117 deletions.
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29369,6 +29369,13 @@ try {
}
// action
await _actions_io__WEBPACK_IMPORTED_MODULE_3__.mkdirP(reportBaseDir);
// cleanup (should be before the folder listing)
if (branchCleanupEnabled) {
await (0,_src_cleanup_js__WEBPACK_IMPORTED_MODULE_7__/* .cleanupOutdatedBranches */ .B)(ghPagesBaseDir, _actions_github__WEBPACK_IMPORTED_MODULE_2__.context.repo);
}
if (maxReports > 0) {
await (0,_src_cleanup_js__WEBPACK_IMPORTED_MODULE_7__/* .cleanupOutdatedReports */ .g)(ghPagesBaseDir, maxReports);
}
// folder listing
if (listDirs) {
if (await (0,_src_writeFolderListing_js__WEBPACK_IMPORTED_MODULE_4__/* .shouldWriteRootHtml */ .z)(ghPagesPath)) {
Expand Down Expand Up @@ -29404,12 +29411,6 @@ try {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput('test_result_total', results.total);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput('run_unique_id', runUniqueId);
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput('report_path', reportDir);
if (branchCleanupEnabled) {
await (0,_src_cleanup_js__WEBPACK_IMPORTED_MODULE_7__/* .cleanupOutdatedBranches */ .B)(ghPagesBaseDir, _actions_github__WEBPACK_IMPORTED_MODULE_2__.context.repo);
}
if (maxReports > 0) {
await (0,_src_cleanup_js__WEBPACK_IMPORTED_MODULE_7__/* .cleanupOutdatedReports */ .g)(ghPagesBaseDir, maxReports);
}
}
catch (error) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setFailed(error.message);
Expand Down
15 changes: 8 additions & 7 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ try {
// action
await io.mkdirP(reportBaseDir)

// cleanup (should be before the folder listing)
if (branchCleanupEnabled) {
await cleanupOutdatedBranches(ghPagesBaseDir, github.context.repo)
}
if (maxReports > 0) {
await cleanupOutdatedReports(ghPagesBaseDir, maxReports)
}

// folder listing
if (listDirs) {
if (await shouldWriteRootHtml(ghPagesPath)) {
Expand Down Expand Up @@ -114,13 +122,6 @@ try {
core.setOutput('test_result_total', results.total)
core.setOutput('run_unique_id', runUniqueId)
core.setOutput('report_path', reportDir)

if (branchCleanupEnabled) {
await cleanupOutdatedBranches(ghPagesBaseDir, github.context.repo)
}
if (maxReports > 0) {
await cleanupOutdatedReports(ghPagesBaseDir, maxReports)
}
} catch (error) {
core.setFailed(error.message)
}
Loading

0 comments on commit 8227e48

Please sign in to comment.