When creating merge requests I have a number of stages such as checking formating, linting, compiling etc.
formatting: stage: formatting image: rust before_script: - rustup component add rustfmt script: - cargo fmt --all -- --check rules: - if: $CI_MERGE_REQUEST_ID
My preference for merging is fast forwarding/rebasing. So I would like to run each stage upon ever commit, to ensure issues are fixed in the commit they are introduced, rather than just checking the
HEAD of the merge request.
I tried removing
rules: - if: $CI_MERGE_REQUEST_ID
and within the pipelines section of the merge request I can see it being ran for each commit. However, if one fails I am still able to merge the request as the pipeline for the merge request passed.
How am I able to make a merge request unmergeable if a pipeline failed for a commit within a branch I am attempting to merge?