Skip to content

Commit

Permalink
fix(gatsby-source-shopify): env variable to check if on preview or pr…
Browse files Browse the repository at this point in the history
…oduction (#32144)

* fix env variable to check if on preview or production

* fix failing test

* add back in check to make sure on prod branch

* switch to GATSBY prefixed env var to check for pr build
  • Loading branch information
DanielSLew authored Aug 9, 2021
1 parent 2273a05 commit b1d9c94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ describe(`A production build`, () => {

describe(`When an operation gets canceled`, () => {
const bulkResult = { id: `gid://shopify/Product/12345` }
process.env.GATSBY_IS_PREVIEW = `true`

beforeEach(() => {
server.use(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function makeSourceFromOperation(
) {
return async function sourceFromOperation(
op: IShopifyBulkOperation,
isPriorityBuild = process.env.IS_PRODUCTION_BRANCH === `true`
// A build on the main branch && a production build
isPriorityBuild = process.env.GATSBY_IS_PR_BUILD !== `true` &&
process.env.GATSBY_IS_PREVIEW !== `true`
): Promise<void> {
const { reporter, actions } = gatsbyApi

Expand Down

0 comments on commit b1d9c94

Please sign in to comment.