Skip to content

Commit

Permalink
Fix cleanup and bump deps (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrybyk authored Jul 23, 2024
1 parent bdfe724 commit ba8e017
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 183 deletions.
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM timbru31/java-node:17-alpine-jre-20

ARG RELEASE=2.29.0
ARG RELEASE=2.30.0
ARG ALLURE_REPO=https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline

RUN echo "===============" && \
Expand Down
13 changes: 12 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29903,6 +29903,17 @@ const cleanupOutdatedBranches = async (ghPagesBaseDir, repo) => {
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 @@ -29918,7 +29929,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
Loading

0 comments on commit ba8e017

Please sign in to comment.