Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run cleanup before folder listing #5

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38652,6 +38652,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);
}
if (maxReports > 0) {
await (0,_src_cleanup_js__WEBPACK_IMPORTED_MODULE_7__/* .cleanupOutdatedReports */ .g)(ghPagesBaseDir, maxReports);
}
// process report
if (reportType === 'html') {
await _actions_io__WEBPACK_IMPORTED_MODULE_3__.cp(sourceReportDir, reportDir, { recursive: true });
Expand Down Expand Up @@ -38680,12 +38687,6 @@ try {
_actions_core__WEBPACK_IMPORTED_MODULE_1__.setOutput('report_history_url', ghPagesBaseUrl);
_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);
}
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 @@ -70,6 +70,14 @@ try {
// action
await io.mkdirP(reportBaseDir)

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

// process report
if (reportType === 'html') {
await io.cp(sourceReportDir, reportDir, { recursive: true })
Expand Down Expand Up @@ -99,13 +107,6 @@ try {
core.setOutput('report_history_url', ghPagesBaseUrl)
core.setOutput('run_unique_id', runUniqueId)
core.setOutput('report_path', reportDir)

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