From e3bc8c752e95ba9209cc51b1756653a702d8c167 Mon Sep 17 00:00:00 2001 From: Marco Arduini Date: Thu, 7 May 2026 16:20:42 +0300 Subject: [PATCH] Add product/collection handle and password inputs to Lighthouse CI Passing SHOP_PRODUCT_HANDLE and SHOP_COLLECTION_HANDLE as repository variables lets the action skip its Admin API lookup for the first published product/collection, so SHOP_ACCESS_TOKEN no longer needs the read_products scope (a Theme Access token is sufficient). SHOP_PASSWORD adds support for password-protected storefronts. --- README.md | 6 ++++++ github-workflows/lighthouse-ci.yml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 5ff83a3..067466b 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,9 @@ The following secrets need to be added to your GitHub repository for the workflo - `LHCI_GITHUB_APP_TOKEN`: [Lighthouse GitHub app](https://github.com/apps/lighthouse-ci) token. Install the app on your repository to generate the token. - `SHOPIFY_CLI_THEME_TOKEN`: Your Shopify CLI theme token. Follow https://shopify.dev/docs/storefronts/themes/tools/cli/ci-cd#step-1-get-a-theme-access-password-for-the-store +### Optional Secrets and Variables +The Lighthouse CI workflow accepts the following optional inputs: +- `SHOP_PASSWORD` (secret): Storefront password for password-protected stores. +- `SHOP_PRODUCT_HANDLE` (variable): Handle of the product page to audit. When set, the action skips the Admin API call used to look up the first published product, so `SHOP_ACCESS_TOKEN` no longer needs the `read_products` scope (a Theme Access token is enough). +- `SHOP_COLLECTION_HANDLE` (variable): Handle of the collection page to audit. Same effect as above for the collection lookup. + diff --git a/github-workflows/lighthouse-ci.yml b/github-workflows/lighthouse-ci.yml index df2435e..a286697 100644 --- a/github-workflows/lighthouse-ci.yml +++ b/github-workflows/lighthouse-ci.yml @@ -11,6 +11,9 @@ jobs: with: store: ${{ secrets.SHOP_STORE }} access_token: ${{ secrets.SHOP_ACCESS_TOKEN }} + password: ${{ secrets.SHOP_PASSWORD }} + product_handle: ${{ vars.SHOP_PRODUCT_HANDLE }} + collection_handle: ${{ vars.SHOP_COLLECTION_HANDLE }} lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} lhci_min_score_performance: 0.9 lhci_min_score_accessibility: 0.9