From 554a44398c362f8e5833227a83269a16ecabba46 Mon Sep 17 00:00:00 2001 From: Jabar Asadi Date: Thu, 7 Sep 2023 15:26:59 +0200 Subject: [PATCH] fix: only checks the commits from the current PR --- make/pre-commit.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/make/pre-commit.mk b/make/pre-commit.mk index 39d054301..f08fc4598 100644 --- a/make/pre-commit.mk +++ b/make/pre-commit.mk @@ -11,4 +11,6 @@ ifeq ($(wildcard $(PRE_COMMIT_CONFIG_FILE)),) $(error Cannot find pre-commit config file $(PRE_COMMIT_CONFIG_FILE). Specify the config file via PRE_COMMIT_CONFIG_FILE variable) endif env SKIP=$(SKIP) pre-commit run -a --show-diff-on-failure --config $(PRE_COMMIT_CONFIG_FILE) - git fetch origin main && gitlint --ignore-stdin --commits origin/main..HEAD + git fetch origin main + merge_base=$(git merge-base HEAD origin/main) + gitlint --ignore-stdin --commits ${merge_base}..HEAD