Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,11 @@ jobs:

## Authentication

Authentication is done with [Custom App access tokens](https://shopify.dev/apps/auth/admin-app-access-tokens).
Authentication is done with [Theme Access](https://apps.shopify.com/theme-access).

1. [Create the app](https://help.shopify.com/en/manual/apps/custom-apps#create-and-install-a-custom-app).
2. Click the `Configure Admin API Scopes` button.
3. Enable the following scopes:
- `read_products`
- `write_themes`
4. Click `Save`.
5. From the `API credentials` tab, install the app.
6. Take note of the `Admin API access token`.
7. Add the following to your repository's [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository):
1. Install it in your store
2. Generate the theme access token
4. Add the following to your repository's [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository):
- `SHOP_ACCESS_TOKEN`: the Admin API access token
- `SHOP_STORE`: Shopify store `<store>.myshopify.com` URL

Expand All @@ -59,6 +53,7 @@ The `shopify/lighthouse-ci-action` accepts the following arguments:
* `pull_theme` - (optional) The ID or name of a theme from which the settings and JSON templates should be used. If not provided Lighthouse will be run against the theme's default settings.
* `lhci_min_score_performance` - (optional, default: 0.6) Minimum performance score for a passed audit (must be between 0 and 1).
* `lhci_min_score_accessibility` - (optional, default: 0.9) Minimum accessibility score for a passed audit
* `delete_theme_after_result` – (optional, default: 0) Deletes the theme that was created after the process completes.(must be 0 or 1)

For the GitHub Status Checks on PR. One of the two arguments is required:

Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[[ -n "$INPUT_COLLECTION_HANDLE" ]] && export SHOP_COLLECTION_HANDLE="$INPUT_COLLECTION_HANDLE"
[[ -n "$INPUT_THEME_ROOT" ]] && export THEME_ROOT="$INPUT_THEME_ROOT"
[[ -n "$INPUT_PULL_THEME" ]] && export SHOP_PULL_THEME="$INPUT_PULL_THEME"
[[ -n "$INPUT_DELETE_THEME_AFTER_RESULT" ]] && export SHOP_DELETE_THEME_AFTER_RESULT="$INPUT_DELETE_THEME_AFTER_RESULT"

# Authentication creds
export SHOP_ACCESS_TOKEN="$INPUT_ACCESS_TOKEN"
Expand Down Expand Up @@ -246,3 +247,6 @@ EOF

step "Running Lighthouse CI"
lhci autorun
if [ "$SHOP_DELETE_THEME_AFTER_RESULT" = "1" ]; then
shopify theme delete --theme ${preview_id} -f
fi
Loading