From 086cc06b9c6402c73afcad4334d69fac7ca825aa Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Tue, 22 Dec 2020 20:12:19 -0800 Subject: gitlab-ci: Re-enable builds for merge requests. When the whitespace job was added, we marked it with only: merge_requests because we wanted it to only run on new merge requests. However, adding an `only` clause like this disables all the unmarked jobs for merge requests, which means we don't get the more important feedback about build failures. Instead, use the `rules` key, added in Gitlab 12.3. This more flexible mechanism is currently recommended and lets us specify what we want without having to add additional decorations to every other job. --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70c243b5..83134404 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,10 +6,12 @@ default: whitespace: stage: test - only: - - merge_requests script: - git diff-tree --check origin/master HEAD + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: always + - when: never autoconf: stage: build -- cgit v1.2.1