feat: add optional best-practices and SEO score thresholds#107
Open
johnzook wants to merge 2 commits into
Open
feat: add optional best-practices and SEO score thresholds#107johnzook wants to merge 2 commits into
johnzook wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_performanceandlhci_min_score_accessibilityinputs. 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
Implementation
lighthouserc.ymlonly when provided (keeps the heredoc clean and avoids empty assertions)Testing
Validated in production CI on a Shopify store (zookanalytics/altareina) with all four categories configured and passing.