Add workflow template for MR pipelines
In !141 (merged) we added a new template, /workflow-branch-pipelines.gitlab-ci.yml
which replicated the built in Workflows/Branch-Pipelines.gitlab-ci.yml
template since those templates are being removed in a later version of GitLab.
@rk725 indicated to me today that in terraform deployments we want to ensure that plans are only run for MRs which, in turn, requires use of the related Workflows/MergeRequest-Pipelines.gitlab-ci.yml
template. (This is not so much to ensure that pipelines don't run for branches, but to enable rules to required terraform plan jobs to only run in MRs.)
Add a new template, /workflow-merge-request-pipelines.gitlab-ci.yml
which is analogous to the existing /workflow-branch-pipelines.gitlab-ci.yml
which can be include
-ed from terraform deployments to override the workflow configuration for terraform jobs.
Update: Instead add a template which implements the "branch XOR merge request" pipeline from the GitLab docs.
Open question: do we want to add different behaviours as well? E.g. "allow workflows to run on branches unless a MR is open, in which case allow MR pipelines".
Update: Indeed we do. @rk725 indicated to me that we prefer the "branch XOR merge request" logic from GitLab's docs which uses MR pipelines if a MR is open but uses branch pipelines otherwise.