Skip to content
Snippets Groups Projects
Commit 939ade2b authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Depend intgration pipeline execution on branch protection state

Previously we had the master branch hard-coded in a variable in order to
determine whether to run the integration pipeline (on non-master branch)
or the merge pipeline (on master branch). This variable had to be
adapted everytime we copy a branch, which can potentially be forgotten
and lead to problems.

Remove the hard-coded branch and use the branch protection state for
this decision instead in order to make this more flexible.
parent dbc49ad0
No related branches found
No related tags found
1 merge request!258Depend intgration pipeline execution on branch protection state
Pipeline #58849 passed with stage
in 15 minutes and 26 seconds
......@@ -40,15 +40,15 @@ workflow:
# FIXME: Unfortunately we cannot use variables in regular expressions due to a
# GitLab limitation: https://gitlab.com/gitlab-org/gitlab/-/issues/209904
# As soon as this get fixed, use the regex based rules below instead of checking
# against the MASTER_BRANCH variable.
# if branch is protected.
# Run pipeline if target branch of the merge request has an integration target, i.e.
# INTEGRATION contains a line beginning with the target branch followed by a colon.
# This also implies that the pipeline runs in merge request context only.
# - if: $INTEGRATION =~ /^$CI_MERGE_REQUEST_TARGET_BRANCH_NAME:/m
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $MASTER_BRANCH
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED
# Run pipeline on target branch after merging a merge request.
# - if: $INTEGRATION =~ /^$CI_COMMIT_BRANCH:/m
- if: $CI_COMMIT_BRANCH == $MASTER_BRANCH
- if: $CI_COMMIT_REF_PROTECTED
.skip-for-gitlab-ci-integrations:
rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment