summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Giles <giles@thaumas.net>2020-12-22 20:12:19 -0800
committerRalph Giles <giles@thaumas.net>2020-12-22 20:12:19 -0800
commit086cc06b9c6402c73afcad4334d69fac7ca825aa (patch)
tree606915a6eb3500305bd03019ed046e3647e823ed
parenta923218e9ba59231fe898f305b91076c32209667 (diff)
downloadopus-gitlab-ci-mr.tar.gz
gitlab-ci: Re-enable builds for merge requests.gitlab-ci-mr
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.
-rw-r--r--.gitlab-ci.yml6
1 files 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