From c646b44503922b619e056360f29ab0bb4781f871 Mon Sep 17 00:00:00 2001 From: Yann Rouillard Date: Fri, 23 Feb 2024 01:05:29 +0100 Subject: [PATCH] fix: stop running in template project We don't want to generate the schema.avsc in template project as it causes a breaking change detection at the first commit in the project created from templates. --- kafka/check-local-schemas.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kafka/check-local-schemas.sh b/kafka/check-local-schemas.sh index f9c9eb0..358b536 100755 --- a/kafka/check-local-schemas.sh +++ b/kafka/check-local-schemas.sh @@ -32,6 +32,10 @@ is_git_tracked() { git ls-files --error-unmatch "$1" &> /dev/null || return 1 } +get_repository_url() { + git remote get-url origin +} + get_md5sum() { local file="$1" md5sum "${file}" | awk '{ print $1}' @@ -133,6 +137,9 @@ run_schema_generator_code() { trap clean_temporary_folder EXIT +# We don't want to run on template repositories +[[ "$(get_repository_url)" != "git@github.com:Kpler/template-"* ]] || exit 0 + check_binary_exists "sbt" target_schema_file="schemas/schema.avsc"