Skip to content

Commit

Permalink
devops: run lhci on bot and user landings (#77)
Browse files Browse the repository at this point in the history
* devops: debug github actions

* devops: run lhci on bot and user landings
  • Loading branch information
gaboesquivel authored Apr 6, 2024
1 parent 1f2e01e commit 876c1ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const manifest = ${{ toJSON(steps.lighthouse_audit.outputs.manifest) }};
const links = ${{ toJSON(steps.lighthouse_audit.outputs.links) }};
if (!manifest || Object.keys(manifest).length === 0) {
Expand All @@ -59,18 +58,18 @@ jobs:
const formatResult = (res) => Math.round((res * 100));
const score = (res) => (res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴');
let comment
let comment = '';
Object.keys(manifest).forEach((page) => {
const pageLink = manifest[page].url;
comment += `*Lighthouse ran on [${pageLink}](${pageLink})*\n\n`;
comment += '| Category | Score |\n';
comment += '| --- | --- |\n';
const result = manifest[page].summary;
const pageLink = manifest[page].url;
Object.keys(result).forEach((key) => {
const formattedScore = formatResult(result[key]);
comment += `| ${score(result[key])} ${key} | ${formattedScore} |\n`;
});
});
core.setOutput('comment', comment);
Expand Down

0 comments on commit 876c1ee

Please sign in to comment.