From 6d5456cc779d22a5829356bcad531a72fa6ec60b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 18 Aug 2020 13:18:08 +0200 Subject: [PATCH] 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 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f69eb4752..42a6628cf 100644 --- a/Makefile +++ b/Makefile @@ -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