From 63329d175a0e09cecb79cc13b866893a918ff531 Mon Sep 17 00:00:00 2001 From: Kurnianto Trilaksono Date: Fri, 29 Mar 2024 16:49:10 +0800 Subject: [PATCH] fix logic and add license --- releasing/check-release-helper.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/releasing/check-release-helper.sh b/releasing/check-release-helper.sh index f90effb7f..ae4e6ee68 100755 --- a/releasing/check-release-helper.sh +++ b/releasing/check-release-helper.sh @@ -1,11 +1,17 @@ #!/usr/bin/env bash +# Copyright 2024 The Kubernetes Authors. +# SPDX-License-Identifier: Apache-2.0 + declare PATCH=false declare MINOR=false declare MAJOR=false declare rc=0 -git log $(git describe --tags --abbrev=0)..HEAD --oneline | tee /tmp/release-changelogs.txt +ORIGIN_MASTER="origin/master" +LATEST_TAG=$(git describe --tags --abbrev=0) + +git log "${LATEST_TAG}..HEAD" --oneline | tee /tmp/release-changelogs.txt count=$(cat /tmp/release-changelogs.txt | wc -l) @@ -18,7 +24,7 @@ if [[ $(cat /tmp/release-changelogs.txt | grep feat) ]]; then fi for f in $(find api); do - git diff --exit-code "${f}" + git diff "${LATEST_TAG}...${ORIGIN_MASTER}" --exit-code -- "${f}" if [ $? -eq 1 ]; then echo "Found changes on api dir at ${f}" MAJOR=true