Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Add 2 new env vars: Admin token & store#2269

Merged
isaacroldan merged 3 commits intomainfrom
add-admin-token-store-envvars
Apr 21, 2022
Merged

Add 2 new env vars: Admin token & store#2269
isaacroldan merged 3 commits intomainfrom
add-admin-token-store-envvars

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Apr 20, 2022

WHY are these changes introduced?

We need a way to execute some commands (that need Admin API access) without any interaction.
With this PR we introduce two new Environment variables that allow us to set a store and a token (with access to that store).

If provided, a command like theme pull will ignore any cached session/store and use the ones from the environment.

WHAT is this pull request doing?

  • Add SHOPIFY_CLI_ADMIN_AUTH_TOKEN to inject a custom admin token and avoid the auth process.
  • Add SHOPIFY_CLI_STORE so all Admin requests use this store, the user must have access to this store.

How to test your changes?

Execute this command to get the list of themes of the given store.
SHOPIFY_CLI_ADMIN_AUTH_TOKEN={your_token} SHOPIFY_CLI_STORE={store-name}.myshopify.com bundle exec shopify theme pull

The provided {your_token} must grant access to {store-name}.

Post-release steps

Update checklist

  • I've added a CHANGELOG entry for this PR (if the change is public-facing)
  • I've considered possible cross-platform impacts (Mac, Linux, Windows).
  • I've left the version number as is (we'll handle incrementing this when releasing).
  • I've included any post-release steps in the section above (if needed).

@isaacroldan isaacroldan requested review from a team, amcaplan, jesalerno84 and pepicrft and removed request for a team April 20, 2022 16:04
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants