Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix cleanup and bump deps #14

Merged
merged 1 commit into from
Jul 23, 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
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run checks
13 changes: 12 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30264,6 +30264,17 @@ const cleanupOutdatedBranches = async (ghPagesBaseDir) => {
console.error('cleanup outdated branches failed.', err);
}
};
const sortRuns = (a, b) => {
const tsA = a.split('_')[1];
const tsb = b.split('_')[1];
if (tsA < tsb) {
return -1;
}
if (tsA > tsb) {
return 1;
}
return 0;
};
const cleanupOutdatedReports = async (ghPagesBaseDir, maxReports) => {
try {
const localBranches = (await promises_.readdir(ghPagesBaseDir, { withFileTypes: true })).filter((d) => d.isDirectory()).map((d) => d.name);
Expand All @@ -30279,7 +30290,7 @@ const cleanupOutdatedReports = async (ghPagesBaseDir, maxReports) => {
.map((d) => d.name);
// run per report
if (runs.length > maxReports) {
runs.sort();
runs.sort(sortRuns);
while (runs.length > maxReports) {
await promises_.rm(external_path_.join(ghPagesBaseDir, localBranch, reportName, runs.shift()), {
recursive: true,
Expand Down
2 changes: 1 addition & 1 deletion dist/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ Apache-2.0


convert-csv-to-json
ISC
GPL-3.0
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Expand Down
Loading
Loading