From d3f56cdbfaff052178a82c44b3018ee8e4660914 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 17 Mar 2023 13:41:05 +0100 Subject: [PATCH] build: fix format-changelog.sh to include only newly added files --- scripts/rel/format-changelog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rel/format-changelog.sh b/scripts/rel/format-changelog.sh index 8474f24bb..0bbcc28ea 100755 --- a/scripts/rel/format-changelog.sh +++ b/scripts/rel/format-changelog.sh @@ -115,9 +115,9 @@ if [ "$PROFILE" == "emqx-enterprise" ]; then changes_dir+=("$top_dir/changes/ee") fi -while read -d "" -r file; do +while read -r file; do PRS+=("$file") -done < <(git diff --name-only -z -a "tags/${BASE_TAG}...HEAD" "${changes_dir[@]}") +done < <(git diff --name-status "tags/${BASE_TAG}...HEAD" "${changes_dir[@]}" | grep -E '^A.*' | awk '{print $2}') TEMPLATE_FEAT_CHANGES="$(section 'feat')" TEMPLATE_PERF_CHANGES="$(section 'perf')"