Skip to content

Commit

Permalink
Merge pull request #4979 from mloiseleur/feat/changelog
Browse files Browse the repository at this point in the history
chore(ci): fix and sort changelog
  • Loading branch information
k8s-ci-robot authored Jan 9, 2025
2 parents f8057a7 + 5b72dba commit 887c519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/releaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ function generate_changelog {
while read -r sha title; do
pr_num="$(grep -o '#[[:digit:]]\+' <<<"$title")"
pr_desc="$(git show -s --format=%b "$sha" | sed -n '1,/^$/p' | tr $'\n' ' ')"
pr_author="$(gh pr view "$pr_num" | grep author | awk '{ print $2 }' | tr $'\n' ' ')"
pr_author="$(gh pr view "$pr_num" | grep "author:" | awk '{ print $2 }' | tr $'\n' ' ')"
printf "* %s (%s) @%s\n\n" "$pr_desc" "$pr_num" "$pr_author"
done

git log "$previous_tag".. --reverse --oneline --grep='(#' | \
while read -r sha title; do
pr_num="$(grep -o '#[[:digit:]]\+' <<<"$title")"
pr_desc="$(git show -s --format=%s "$sha")"
pr_author="$(gh pr view "$pr_num" | grep author | awk '{ print $2 }' | tr $'\n' ' ')"
pr_author="$(gh pr view "$pr_num" | grep "author:" | awk '{ print $2 }' | tr $'\n' ' ')"
printf "* %s (%s) @%s\n\n" "$pr_desc" "$pr_num" "$pr_author"
done
}

function create_release {
generate_changelog | gh release create "$1" -t "$1" -F -
generate_changelog | sort | gh release create "$1" -t "$1" -F -
}

if [ $# -ne 1 ]; then
Expand Down

0 comments on commit 887c519

Please sign in to comment.