Skip to content
OpenStock
OpenStock

Get started

Theme CLIInstall and sign in

Workflow

Develop a themeSyncing and conflictsCI and automation

Reference

Commands
Dashboard
  1. CLI
  2. Workflow

CI and automation

Publish a theme from GitHub Actions or any CI with an environment variable.

In CI the CLI reads the key from OPENSTOCK_API_KEY, so there is nothing to log in to. Use a dedicated key with only the Theme code: Write and Store details: Read scopes, and pass --yes because there is nobody to answer the confirmation.

GitHub Actions#

.github/workflows/publish-theme.yml
name: Publish theme
on:
  push:
    branches: [main]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npx @openstock/cli publish --yes --force
        env:
          OPENSTOCK_API_KEY: ${{ secrets.OPENSTOCK_API_KEY }}

--force makes the repository the source of truth: it overwrites drafts that were edited in the dashboard. Leave it out if you want the job to fail instead.

Exit codes#

CodeMeaning
0Success.
1The command failed: bad key, missing scope, conflict or build error.
2Unknown command or option.

Was this page helpful?

PreviousSyncing and conflictsNextCommands
© 2026 OpenStockTermsPrivacy