Skip to content

Commit e46a439

Browse files
authored
Add additional check to CI for 'docs-builder' repos. (#2587)
This is just in case 'Create Deployment' ever gets refactored away.
1 parent cf49432 commit e46a439

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/preview-build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,21 @@ jobs:
330330
331331
- name: Bootstrap Action Workspace
332332
if: >
333-
env.MATCH == 'true'
333+
env.MATCH == 'true'
334334
&& github.repository == 'elastic/docs-builder'
335335
&& steps.deployment.outputs.result
336+
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
336337
uses: elastic/docs-builder/.github/actions/bootstrap@main
337338

338339
- name: 'Validate redirect rules'
339340
if: >
340341
env.MATCH == 'true'
341342
&& github.repository == 'elastic/docs-builder'
343+
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
342344
&& (
343345
steps.deployment.outputs.result
344346
|| (
345-
needs.check.outputs.any_modified == 'true'
347+
needs.check.outputs.any_modified == 'true'
346348
&& github.event_name == 'merge_group'
347349
)
348350
)
@@ -372,6 +374,7 @@ jobs:
372374
env.MATCH == 'true'
373375
&& github.repository == 'elastic/docs-builder'
374376
&& steps.deployment.outputs.result
377+
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
375378
run: |
376379
dotnet run --project src/tooling/docs-builder -- --strict --path-prefix "${PATH_PREFIX}"
377380
@@ -419,11 +422,12 @@ jobs:
419422
&& (
420423
!cancelled()
421424
&& github.repository == 'elastic/docs-builder'
422-
&& steps.internal-docs-build.outputs.skip != 'true'
425+
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
426+
&& steps.internal-docs-build.outputs.skip != 'true'
423427
&& (
424428
steps.deployment.outputs.result
425429
|| (
426-
needs.check.outputs.any_modified == 'true'
430+
needs.check.outputs.any_modified == 'true'
427431
&& github.event_name == 'merge_group'
428432
)
429433
)
@@ -453,14 +457,15 @@ jobs:
453457
if: >
454458
env.MATCH == 'true'
455459
&& (
456-
!cancelled()
460+
!cancelled()
457461
&& github.repository == 'elastic/docs-builder'
462+
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
458463
&& steps.internal-docs-build.outputs.skip != 'true'
459464
&& steps.internal-docs-build.outcome != 'skipped'
460465
&& (
461-
steps.deployment.outputs.result
466+
steps.deployment.outputs.result
462467
|| (
463-
needs.check.outputs.any_modified == 'true'
468+
needs.check.outputs.any_modified == 'true'
464469
&& github.event_name == 'merge_group'
465470
)
466471
)

0 commit comments

Comments
 (0)