Skip to content

Commit 9d19fe3

Browse files
committed
check parent MRs
1 parent 57f1904 commit 9d19fe3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.gitlab-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ generator:
5454

5555
generated pipeline:
5656
stage: run
57+
variables:
58+
# Forward MR context to child pipeline since $CI_PIPELINE_SOURCE becomes
59+
# "parent_pipeline" in downstream pipelines and MR variables are not inherited.
60+
PARENT_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
61+
PARENT_OPEN_MRS: $CI_OPEN_MERGE_REQUESTS
5762
trigger:
5863
include:
5964
- artifact: .gitlab/pipeline.yaml

.gitlab/templates/pipeline.yaml.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ publish layer e2e sandbox ({{ $f.name }}):
244244
when: on_success
245245
variables:
246246
LAYER_DESCRIPTION: $CI_COMMIT_TAG
247-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_MERGE_REQUEST_IID || $CI_OPEN_MERGE_REQUESTS'
247+
- if: '$PARENT_PIPELINE_SOURCE == "merge_request_event" || $PARENT_OPEN_MRS'
248248
when: on_success
249249
variables:
250250
LAYER_DESCRIPTION: $CI_COMMIT_SHORT_SHA
@@ -283,7 +283,7 @@ e2e-test ({{ $f.name }}):
283283
when: on_success
284284
variables:
285285
EXTENSION_VERSION: $CI_COMMIT_TAG
286-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_MERGE_REQUEST_IID || $CI_OPEN_MERGE_REQUESTS'
286+
- if: '$PARENT_PIPELINE_SOURCE == "merge_request_event" || $PARENT_OPEN_MRS'
287287
when: on_success
288288
variables:
289289
EXTENSION_VERSION: $CI_COMMIT_SHORT_SHA
@@ -301,7 +301,7 @@ e2e-test-status ({{ $f.name }}):
301301
rules:
302302
- if: '$CI_COMMIT_TAG =~ /^v.*/'
303303
when: on_success
304-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_MERGE_REQUEST_IID || $CI_OPEN_MERGE_REQUESTS'
304+
- if: '$PARENT_PIPELINE_SOURCE == "merge_request_event" || $PARENT_OPEN_MRS'
305305
when: on_success
306306
needs:
307307
- job: "e2e-test ({{ $f.name }})"

0 commit comments

Comments
 (0)