Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access more detailed metrics #132

Open
maecapozzi opened this issue Jun 20, 2023 · 2 comments
Open

Access more detailed metrics #132

maecapozzi opened this issue Jun 20, 2023 · 2 comments

Comments

@maecapozzi
Copy link

maecapozzi commented Jun 20, 2023

Hey! Thanks for this Github action. It's been a great way to programmatically check our scores.

I know the lighthouse node module allows us to access more detailed metrics, like TTI and FCP. While I'm able to access the summary from the manifest, I'd like more than just the top level scores like "performance" and "best practices".

This is what I'm doing right now:

 - name: Display Lighthouse Audit Results
        uses: actions/github-script@v6
        id: set-result
        env:
          MANIFEST: ${{ steps.lighthouse.outputs.manifest }}
        with:
          script: |
            const script = require('./lighthouse-audits/results.js');
            script();
          result-encoding: string

Then I'm accessing the manifest in ./lighthouse-audits/results.js like this:

  const { MANIFEST } = process.env;
   const manifest = JSON.parse(MANIFEST);

Can we expose more detailed metrics in the manifest?

@Nierdhaza
Copy link

I would also like to see more metrics as FCP, LCP, TTI, TBT etc.

@maecapozzi
Copy link
Author

maecapozzi commented Oct 10, 2023

I was able to capture more detailed metrics, but it was relatively challenging. Here's a snippet of what I did, which will hopefully help other people!

 - name: Download result of lighthouse-audit
        uses: actions/download-artifact@v3
        id: download
        with:
          name: lighthouse-results
          path: ${{ github.workspace }}/lighthouse-results

      - name: Display Lighthouse Audit Results
        uses: actions/github-script@v6
        id: set-result
        env:
          WORKSPACE: ${{ steps.download.outputs.download-path }}
        with:
          script: |
            const script = require('./lighthouse-audits/results.js');

            script();
          result-encoding: string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants