summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-08 16:44:55 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-08 16:44:55 -0400
commit8754002973dcde8709458044e541ddc8f4fcf6bb (patch)
tree1d9b0e96172abfafd113cb02d1844a8ffefaeda9
parent4a72259d6dcc350d37a50064c18ffcafd03233be (diff)
downloadhaskell-8754002973dcde8709458044e541ddc8f4fcf6bb.tar.gz
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.
-rw-r--r--.gitlab-ci.yml4
1 files 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