gitlab-ci: add whitespace error check

GitLab CI does not have a job to check for whitespace errors introduced by a set of changes. Reuse the existing generic `whitespace-check.sh` to create the job for GitLab pipelines. Note that the `$CI_MERGE_REQUEST_TARGET_BRANCH_SHA` variable is only available in GitLab merge request pipelines and therefore the CI job is configured to only run as part of those pipelines. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Justin Tobler committed May 3, 2024 at 12:21 UTC 8f19e82c5b313a1518119cc4b31c32ec3001b967
1 file changed +9
.gitlab-ci.yml
+9
@@ -102,3 +102,12 @@ static-analysis:
102 script:
103 - ./ci/run-static-analysis.sh
104 - ./ci/check-directional-formatting.bash
105 +
106 +check-whitespace:
107 + image: ubuntu:latest
108 + before_script:
109 + - ./ci/install-dependencies.sh
110 + script:
111 + - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
112 + rules:
113 + - if: $CI_PIPELINE_SOURCE == 'merge_request_event'