Skip to content

feat: add optional best-practices and SEO score thresholds#107

Open
johnzook wants to merge 2 commits into
Shopify:mainfrom
zookanalytics:feat/optional-score-categories
Open

feat: add optional best-practices and SEO score thresholds#107
johnzook wants to merge 2 commits into
Shopify:mainfrom
zookanalytics:feat/optional-score-categories

Conversation

@johnzook
Copy link
Copy Markdown

Summary

Adds two new optional inputs for asserting Lighthouse best-practices and SEO scores:

  • lhci_min_score_best_practices — minimum best practices score (not asserted if omitted)
  • lhci_min_score_seo — minimum SEO score (not asserted if omitted)

These follow the same pattern as the existing lhci_min_score_performance and lhci_min_score_accessibility inputs. They are fully optional with no defaults, so existing workflows are unaffected.

Why

Lighthouse audits already run best-practices and SEO checks, but the action only lets you set pass/fail thresholds for performance and accessibility. Theme developers who want CI gates for all four Lighthouse categories currently have no way to do so without a custom lighthouserc.yml.

Usage

- uses: shopify/lighthouse-ci-action@v1
  with:
    store: $\{{ secrets.SHOP_STORE }}
    client_id: $\{{ secrets.SHOP_CLIENT_ID }}
    client_secret: $\{{ secrets.SHOP_CLIENT_SECRET }}
    lhci_min_score_performance: 0.6
    lhci_min_score_accessibility: 0.9
    lhci_min_score_best_practices: 0.7
    lhci_min_score_seo: 0.9

Implementation

  • New inputs are appended as assertions to lighthouserc.yml only when provided (keeps the heredoc clean and avoids empty assertions)
  • Follows existing code patterns for input mapping and variable defaults
  • Backwards compatible — no changes to default behavior

Testing

Validated in production CI on a Shopify store (zookanalytics/altareina) with all four categories configured and passing.

Add lhci_min_score_best_practices and lhci_min_score_seo inputs.
When set, these add assertion blocks to lighthouserc.yml. When
omitted, no assertion is made (backwards compatible).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant