From 8754002973dcde8709458044e541ddc8f4fcf6bb Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sat, 8 Jun 2019 16:44:55 -0400 Subject: gitlab-ci: Ensure that all commits on a branch are submodule-linted The previous commit reworked things such that the submodule linter would only run on the head commit. However, the linter only checks the submodules which are touched by the commits it is asked to lint. Consequently it would be possible for a bad submodule to sneak through. Thankfully, we can use the handy CI_COMMIT_BEFORE_SHA attribute to find the base commit of the push. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 570ea487d6..e8a5a2821c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -108,8 +108,8 @@ lint-submods-mr: lint-submods-branch: extends: .lint-submods script: - - "echo Linting submodule changes for $CI_COMMIT_SHA" - - submodchecker .git $CI_COMMIT_SHA + - "echo Linting submodule changes between $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA" + - submodchecker .git $(git rev-list $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA) only: refs: - master -- cgit v1.2.1