Fixes #18. Also fixes an issue with the Lighthouse CI returning only 1 report (of the password page itself).
Setup:
Using a Custom App for authentication
All standard variables set via GitHub Secrets
I'm not using my Partner account for this Shopify Store (I'm using a staff account instead)
The problem:
Lighthouse CI is running tests on the live store, not on the development store.
The Lighthouse report is only showing results for the password page of the live store.
How this PR fixes the problem:
One of the main things I noticed, is that $host is the main Shopify store url, which ignores the new development store created by this action. That $host is being used on a few places where the development preview url is needed instead.
Maybe it was possible to use $preview_url instead of $host, but at the same time 1) the preview_url path differs for the index, products and collections; and 2) we need the $query_string.
Steps to fix the problem:
When we push the development store and it returns the json, create a variable for the new theme id. - Added the theme id on the query string variable, with modifications "?preview_theme_id=$(echo "$preview_id")&_fd=0&pb=0". This will be used on the lighthouse action (around lines 172-198).
Then also added the query string (with the theme id) on the password page url if the store is password protected (lines 206-215), to make sure we're entering the password on the correct store preview.
Other considerations:
I only tested this on one Shopify store
The store tested is a development Shopify Plus store with password enabled
Tested using a fresh Dawn Theme, although the Shopify store itself is not fresh
I'm a front-end developer and my Git, GitHub Actions, node and docker knowledge is still under development. That said, the changes worked for me, so I wanted to share with the community.
Note: this is my first ever PR for a public repo, hooray!
Fixes #18. Also fixes an issue with the Lighthouse CI returning only 1 report (of the password page itself).
Setup:
The problem:
How this PR fixes the problem: One of the main things I noticed, is that
$host
is the main Shopify store url, which ignores the new development store created by this action. That$host
is being used on a few places where the development preview url is needed instead.Maybe it was possible to use
$preview_url
instead of$host
, but at the same time 1) the preview_url path differs for the index, products and collections; and 2) we need the$query_string
.Steps to fix the problem:
"?preview_theme_id=$(echo "$preview_id")&_fd=0&pb=0"
. This will be used on the lighthouse action (around lines 172-198).Other considerations:
Note: this is my first ever PR for a public repo, hooray!