From a33026ee7c70721e18bcb36dcfd1d479baa9b666 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Tue, 8 Sep 2020 12:36:11 +0200 Subject: [PATCH] ci: Add "is post-merge pipeline, not for Marge Bot" YAML anchor Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 542ec0d..de0b56b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,9 @@ stages: # Pipeline runs for the master branch of the main project - if: &is-main-master '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"' when: always + # Post-merge pipeline, not for Marge Bot + - if: &is-post-merge-not-for-marge '$GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME && $CI_PROJECT_PATH == "mesa/mesa"' + when: on_success # Pre-merge pipeline for Marge Bot - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME' when: on_success @@ -85,7 +88,7 @@ test-docs: - if: *is-pre-merge-for-marge changes: *docs-or-ci when: on_success - - if: '$GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME && $CI_PROJECT_PATH == "mesa/mesa"' + - if: *is-post-merge-not-for-marge changes: *docs-or-ci when: on_success - if: '$CI_PROJECT_PATH != "mesa/mesa" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME' @@ -195,7 +198,7 @@ success: when: on_success # Run pipeline by default in the main project if it was not triggered by # Marge Bot, and any files affecting the pipeline were changed - - if: '$GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME && $CI_PROJECT_PATH == "mesa/mesa"' + - if: *is-post-merge-not-for-marge changes: *all_paths when: on_success -- 2.7.4