File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ env_variables:
5
5
FILESET_BASE_URL : ' staging.example.com'
6
6
FILESET_DEFAULT_BRANCH : main
7
7
FILESET_SITE : default
8
+ FILESET_STAGING_ONLY : ' '
8
9
includes :
9
10
- secrets.yaml
10
11
handlers :
Original file line number Diff line number Diff line change @@ -117,12 +117,14 @@ export function parseHostname(
117
117
const cleanBaseUrl = options . baseUrl
118
118
? options . baseUrl . replace ( / ^ ( h t t p s ? ) : \/ \/ / , '' ) . split ( ':' ) [ 0 ]
119
119
: '' ;
120
- const isLive = cleanHostname === cleanBaseUrl ;
120
+ const isProdHostname = cleanHostname === cleanBaseUrl ;
121
121
// Staging, run through supported prefixes.
122
122
if (
123
- ( options . baseUrl && cleanHostname . includes ( cleanBaseUrl ) && ! isLive ) ||
123
+ ( options . baseUrl &&
124
+ cleanHostname . includes ( cleanBaseUrl ) &&
125
+ ! isProdHostname ) ||
124
126
options . hostname . includes ( '.localhost' ) ||
125
- ( options . hostname . includes ( '-dot-' ) && ! isLive )
127
+ ( options . hostname . includes ( '-dot-' ) && ! isProdHostname )
126
128
) {
127
129
// site-ref
128
130
// site-ref-with-dashes
@@ -245,7 +247,9 @@ export function createApp(siteId: string) {
245
247
246
248
// Access control check for staging environments.
247
249
// TODO: Make the `isLive` check work with scheduled branches.
248
- const isLive = defaults . LIVE_BRANCHES . includes ( manifest . branch ) ;
250
+ const stagingOnly = Boolean ( process . env . FILESET_STAGING_ONLY ) ;
251
+ const isLive =
252
+ defaults . LIVE_BRANCHES . includes ( manifest . branch ) && ! stagingOnly ;
249
253
if ( ! isLive ) {
250
254
// If the webui isn't enabled, only live filesets are served. All other
251
255
// paths are disabled.
You can’t perform that action at this time.
0 commit comments