Skip to content

Lighthouse Report

Lighthouse Report #74

Workflow file for this run

name: Lighthouse Report
on:
deployment_status
jobs:
generate_lighthouse_audit:
name: Deployment Audit
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'catalyst-latest') }}
steps:
- name: Checkout code
uses: actions/checkout@main
- uses: pnpm/action-setup@v3
- name: Audit preview URL with Lighthouse
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@v11
with:
urls: |
${{ github.event.deployment_status.target_url }}
uploadArtifacts: true
temporaryPublicStorage: true
runs: 3
- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/github-script@v7
with:
script: |
const lighthouseCommentMaker = require('./.github/workflows/lighthouseCommentMaker.js');
const lighthouseOutputs = {
manifest: ${{ steps.lighthouse_audit.outputs.manifest }},
links: ${{ steps.lighthouse_audit.outputs.links }}
};
const comment = lighthouseCommentMaker({ lighthouseOutputs });
core.setOutput("comment", comment);
- name: Find pull request
uses: jwalton/[email protected]
id: finder
- name: Add comment to PR
id: comment_to_pr
uses: marocchino/[email protected]
with:
recreate: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.finder.outputs.pr }}
header: lighthouse
message: ${{ steps.format_lighthouse_score.outputs.comment }}