From 6f2623e11de8c7a77d6e8d0075cbe910f287bc3f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Fri, 18 Nov 2022 18:30:13 +0200 Subject: [PATCH] scripts: Fix `generate_changelog.sh` with empty printf (#719) Signed-off-by: Alexandru Vasile --- scripts/generate_changelog.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/generate_changelog.sh b/scripts/generate_changelog.sh index e2e3fbdb22..3eaabe913b 100755 --- a/scripts/generate_changelog.sh +++ b/scripts/generate_changelog.sh @@ -55,8 +55,10 @@ function generate_changelog() { pr_link="$REMOTE_LINK$pr_number" # Generate the link as markdown. pr_md_link=" ([#$pr_number]($pr_link))" - # Print the changelog line as `- commit-title pr-link`. - echo "$line" | awk -v var="$pr_md_link" '{NF--; printf "- "; printf; print var}' + # Print every word from the commit title, except the last word. + # The last word is the PR id that is already included by the pr-link. + # The changelog line is `- commit-title pr-link`. + echo "$line" | awk -v link="$pr_md_link" '{ printf "- "; for(i=1;i<=NF-1;i++) { printf $i" "} print link}' done <<< "$prs" }