]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitlab-ci: add whitespace error check
authorJustin Tobler <jltobler@gmail.com>
Fri, 3 May 2024 17:21:07 +0000 (12:21 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 May 2024 19:11:49 +0000 (12:11 -0700)
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>
.gitlab-ci.yml

index c0fa2fe90b4b81aad0d1ce6f50770cbbbebcebf9..619bf729fa140f9594660b8b627fbc63b1651907 100644 (file)
@@ -102,3 +102,12 @@ static-analysis:
   script:
     - ./ci/run-static-analysis.sh
     - ./ci/check-directional-formatting.bash
+
+check-whitespace:
+  image: ubuntu:latest
+  before_script:
+    - ./ci/install-dependencies.sh
+  script:
+    - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
+  rules:
+    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'