A GitHub Action to sync JSON content (locale strings & JSON templates) between themes in a Shopify store.
- Syncs locale files (
locales/*.json) - Syncs configuration data files (
config/*_data.json) - Syncs template files (
templates/**/*.json) - Supports syncing from live theme or specific unpublished themes
- Merges local changes with remote content
- Only pushes new content, doesn't edit existing content on the target theme
- Safety First: Never pushes to live themes - only pulls from live (or specific source theme) and pushes to unpublished themes
- uses: devil1991/shopify-jsons-sync@v1.4.2
with:
store: '${{ env.SHOPIFY_FLAG_STORE }}'
theme: '${{ env.TARGET_THEME_ID }}'- uses: devil1991/shopify-jsons-sync@v1.4.2
with:
store: '${{ env.SHOPIFY_FLAG_STORE }}'
theme: '${{ env.TARGET_THEME_ID }}' # Where to push
source-theme: '${{ env.SOURCE_THEME_ID }}' # Where to pull from| Input | Required | Default | Description |
|---|---|---|---|
store |
Yes | - | The Shopify store URL or identifier |
theme |
Yes | - | Target theme ID where files will be pushed to |
source-theme |
No | - | Source theme ID to pull JSON files from (if not provided, pulls from live theme) |
working-directory |
No | - | Working directory path if the action should run in a subdirectory |
-
Pull Phase: Downloads JSON files from the source theme:
- Live theme (when
source-themeis not provided, default behavior) - Specific source theme (when
source-themeis provided)
- Live theme (when
-
Sync Phase:
- Merges local JSON files with remote versions
- Remote content takes priority in conflicts
- Removes disabled blocks from merged content
-
Push Phase:
- Pushes merged locale files to the target theme (specified by
themeparameter) - Pushes any new template files that don't exist remotely
- Always uses the
themeparameter as the destination
- Pushes merged locale files to the target theme (specified by
- Pull latest content from source theme (defaults to live theme)
- Push updates to target theme (staging, preview, etc.)
- Useful for most deployment workflows
- Pull content from specific source theme (unpublished/development theme)
- Push updates to target theme
- Useful when working with multiple development themes or when the "source of truth" is not the live theme
- name: Sync JSON from Source Theme
uses: devil1991/shopify-jsons-sync@v1.4.2
with:
store: '${{ env.SHOPIFY_FLAG_STORE }}'
theme: '${{ env.QA_THEME_ID }}'
# No source-theme means it pulls from live theme (default source)- name: Sync JSON between Development Themes
uses: devil1991/shopify-jsons-sync@v1.4.2
with:
store: '${{ env.SHOPIFY_FLAG_STORE }}'
theme: '${{ env.TARGET_THEME_ID }}' # Where to push
source-theme: '${{ env.DEV_THEME_ID }}' # Where to pull from- name: Sync JSON Files
uses: devil1991/shopify-jsons-sync@v1.4.2
with:
store: '${{ env.SHOPIFY_FLAG_STORE }}'
theme: '${{ env.TARGET_THEME_ID }}'
source-theme: ${{ env.ENVIRONMENT != 'production' && env.DEV_THEME_ID || '' }}npm install
npm run build && npm run packagenpm testMIT License - see LICENSE file for details.