Skip to content

Commit

Permalink
ci(preview): Make the result similar to the original
Browse files Browse the repository at this point in the history
Make the comment more easy to understand.
  • Loading branch information
5ouma committed Nov 9, 2024
1 parent 99e9c33 commit 13ce346
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
script: |
const manifest = JSON.parse("${{ steps.lighthouse.outputs.manifest }}");
const gauge = Object.entries(manifest[0].summary).map(([label, percentage]) => {
const score = percentage * 100;
const icon = score >= 90 ? "🟒" : score >= 50 ? "🟠" : "πŸ”΄";
const score = Math.round(percentage * 100);
const icon = score >= 90 ? "🟒" : score >= 50 ? "🟧" : "πŸ”Ί";
return { label, score: `${icon} ${score}` };
});
const labels = `| ${gauge.map(({ label }) => label).join(" | ")} |`;
Expand All @@ -73,4 +73,12 @@ jobs:
## πŸ”¦ Lighthouse Result
${{ steps.summary.outputs.result }}
<details><summary>πŸ“Š Score Scale</summary>
| Fail | Average | Pass |
| :-----: | :------: | :-------: |
| πŸ”Ί 0-49 | 🟧 50-89 | 🟒 90-100 |
</details>
message-id: lighthouse

0 comments on commit 13ce346

Please sign in to comment.