ci: use FETCH_HEAD like "commitlint --from" does

After fetching the target branch for the PR, the GIT_SINCE ref in the
git repository may not be set (in CI environments). This causes 'git
rebase' to fail. Use FETCH_HEAD instead, so that the checked out PR gets
rebased correctly.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-08-18 13:18:08 +02:00 committed by mergify[bot]
parent 104203ed03
commit 6d5456cc77

View File

@ -127,7 +127,7 @@ check-env:
commitlint: REBASE ?= 0
commitlint:
git fetch -v $(shell cut -d/ -f1 <<< "$(GIT_SINCE)") $(shell cut -d/ -f2- <<< "$(GIT_SINCE)")
@test $(REBASE) -eq 0 || git -c user.name=commitlint -c user.email=commitline@localhost rebase $(GIT_SINCE)
@test $(REBASE) -eq 0 || git -c user.name=commitlint -c user.email=commitline@localhost rebase FETCH_HEAD
commitlint --from FETCH_HEAD
.PHONY: cephcsi