Skip to content

Commit

Permalink
deps: Audit 06/24 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Jun 24, 2024
1 parent d203fd0 commit a0c26f5
Show file tree
Hide file tree
Showing 7 changed files with 1,682 additions and 1,879 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.8.0

- Support moon v1.26.
- Updated dependencies.

# 1.7.0

- Added a `skip-comment` input setting to disable commenting on PRs.
Expand Down
29 changes: 5 additions & 24 deletions helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ export function createDetailsSection(title: string, body: string[]): string[] {
];
}

export function formatTotalTime({
duration,
projectedDuration,
estimatedSavings,
comparisonEstimate,
}: RunReport): string {
export function formatTotalTime({ duration, comparisonEstimate }: RunReport): string {
const parts = [`Total time: ${formatDuration(duration)}`];

if (comparisonEstimate) {
Expand All @@ -105,31 +100,15 @@ export function formatTotalTime({
);
}
}
} else if (projectedDuration) {
parts.push(`Projected time: ${formatDuration(projectedDuration)}`);

if (estimatedSavings) {
const percent = calculateSavingsPercentage(projectedDuration, estimatedSavings);

if (percent !== 0) {
if (percent > 0) {
parts.push(
`Estimated savings: ${formatDuration(estimatedSavings)} (${percent}% decrease)`,
);
} else {
parts.push(
`Estimated loss: ${formatDuration(estimatedSavings)} (${Math.abs(percent)}% increase)`,
);
}
}
}
}

return parts.join(' | ');
}

function formatStatusLabel(status: ActionStatus): string {
switch (status) {
case 'aborted':
return 'Aborted';
case 'cached':
case 'cached-from-remote':
return 'Cached';
Expand All @@ -142,6 +121,8 @@ function formatStatusLabel(status: ActionStatus): string {
return 'Passed';
case 'skipped':
return 'Skipped';
case 'timed-out':
return 'Timed out';
default:
return 'Running';
}
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function run() {
// `moon ci` may have run, but nothing may be affected,
// so instead of throwing an error, just log a message.
if (!report) {
core.warning('Run report does not exist, has `moon ci` ran?');
core.warning('Run report does not exist, has `moon ci` or `moon run` ran?');
return;
}

Expand Down
Loading

0 comments on commit a0c26f5

Please sign in to comment.