File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,10 +242,12 @@ jobs:
242242 working-directory : packages/e2e
243243 env :
244244 SHOPIFY_FLAG_CLIENT_ID : ${{ secrets.E2E_CLIENT_ID }}
245+ SHOPIFY_CLI_PARTNERS_TOKEN : ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }}
245246 E2E_ACCOUNT_EMAIL : ${{ secrets.E2E_ACCOUNT_EMAIL }}
246247 E2E_ACCOUNT_PASSWORD : ${{ secrets.E2E_ACCOUNT_PASSWORD }}
247248 E2E_STORE_FQDN : ${{ secrets.E2E_STORE_FQDN }}
248249 E2E_SECONDARY_CLIENT_ID : ${{ secrets.E2E_SECONDARY_CLIENT_ID }}
250+ E2E_ORG_ID : ${{ secrets.E2E_ORG_ID }}
249251 run : npx playwright test
250252 - name : Upload Playwright report
251253 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 1+ /* eslint-disable no-restricted-imports */
2+ import * as fs from 'fs'
3+ import * as path from 'path'
4+ import { fileURLToPath } from 'url'
5+
6+ /**
7+ * Load a .env file into process.env (without overwriting existing values).
8+ * Handles quotes and inline comments (e.g. "VALUE # comment" → "VALUE").
9+ */
10+ export function loadEnv ( dirOrUrl : string ) : void {
11+ const dir = dirOrUrl . startsWith ( 'file://' ) ? path . dirname ( fileURLToPath ( dirOrUrl ) ) : dirOrUrl
12+ const envPath = path . join ( dir , '.env' )
13+ if ( ! fs . existsSync ( envPath ) ) return
14+
15+ for ( const line of fs . readFileSync ( envPath , 'utf-8' ) . split ( '\n' ) ) {
16+ const trimmed = line . trim ( )
17+ if ( ! trimmed || trimmed . startsWith ( '#' ) ) continue
18+ const eqIdx = trimmed . indexOf ( '=' )
19+ if ( eqIdx === - 1 ) continue
20+ const key = trimmed . slice ( 0 , eqIdx ) . trim ( )
21+ let value = trimmed . slice ( eqIdx + 1 ) . trim ( )
22+ if ( ( value . startsWith ( '"' ) && value . endsWith ( '"' ) ) || ( value . startsWith ( "'" ) && value . endsWith ( "'" ) ) ) {
23+ value = value . slice ( 1 , - 1 )
24+ } else {
25+ const commentIdx = value . indexOf ( ' #' )
26+ if ( commentIdx !== - 1 ) value = value . slice ( 0 , commentIdx ) . trim ( )
27+ }
28+ process . env [ key ] ??= value
29+ }
30+ }
Original file line number Diff line number Diff line change 11/* eslint-disable line-comment-position */
2- /* eslint-disable no-restricted-imports */
2+ import { loadEnv } from './helpers/load-env.js'
33import { defineConfig } from '@playwright/test'
4- import * as fs from 'fs'
5- import * as path from 'path'
6- import { fileURLToPath } from 'url'
74
8- const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
9-
10- // Load .env file if present (CI provides env vars directly)
11- const envPath = path . join ( __dirname , '.env' )
12- if ( fs . existsSync ( envPath ) ) {
13- for ( const line of fs . readFileSync ( envPath , 'utf-8' ) . split ( '\n' ) ) {
14- const trimmed = line . trim ( )
15- if ( ! trimmed || trimmed . startsWith ( '#' ) ) continue
16- const eqIdx = trimmed . indexOf ( '=' )
17- if ( eqIdx === - 1 ) continue
18- const key = trimmed . slice ( 0 , eqIdx ) . trim ( )
19- const value = trimmed . slice ( eqIdx + 1 ) . trim ( )
20- process . env [ key ] ??= value
21- }
22- }
5+ loadEnv ( import . meta. url )
236
247const isCI = Boolean ( process . env . CI )
258
You can’t perform that action at this time.
0 commit comments