chore(scripts): fix a few release script changelog issues (#13200)

This commit is contained in:
Mathias Fredriksson
2024-05-17 11:19:48 +03:00
committed by GitHub
parent 92c5dfa266
commit 0998cedb5c
3 changed files with 15 additions and 4 deletions

View File

@ -210,6 +210,7 @@ new_version="${new_version%$'\n'}" # Remove the trailing newline.
release_notes="$(execrelative ./release/generate_release_notes.sh --old-version "$old_version" --new-version "$new_version" --ref "$ref")"
mkdir -p build
release_notes_file="build/RELEASE-${new_version}.md"
if ((dry_run)); then
release_notes_file="build/RELEASE-${new_version}-DRYRUN.md"

View File

@ -99,7 +99,9 @@ main() {
git_cherry_out=$(
{
git log --no-merges --cherry-mark --pretty=format:"%m %H %s" "${to_ref}...origin/main"
echo
git log --no-merges --cherry-mark --pretty=format:"%m %H %s" "${from_ref}...origin/main"
echo
} | { grep '^=' || true; } | sort -u | sort -k3
)
if [[ -n ${git_cherry_out} ]]; then
@ -209,6 +211,15 @@ main() {
fi
fi
author=
if [[ -v authors[${commit_sha_long}] ]]; then
author=${authors[${commit_sha_long}]}
if [[ ${author} == "app/dependabot" ]]; then
log "Skipping commit by app/dependabot ${commit_sha_short} (${commit_sha_long})"
continue
fi
fi
if [[ ${left_right} == "<" ]]; then
# Skip commits that are already in main.
log "Skipping commit ${commit_sha_short} from other branch (${commit_sha_long} ${title})"
@ -218,7 +229,7 @@ main() {
COMMIT_METADATA_COMMITS+=("${commit_sha_long_orig}")
# Safety-check, guarantee all commits had their metadata fetched.
if [[ ! -v authors[${commit_sha_long}] ]] || [[ ! -v labels[${commit_sha_long}] ]]; then
if [[ -z ${author} ]] || [[ ! -v labels[${commit_sha_long}] ]]; then
if [[ ${ignore_missing_metadata} != 1 ]]; then
error "Metadata missing for commit ${commit_sha_short} (${commit_sha_long})"
else
@ -228,8 +239,8 @@ main() {
# Store the commit title for later use.
COMMIT_METADATA_TITLE[${commit_sha_short}]=${title}
if [[ -v authors[${commit_sha_long}] ]]; then
COMMIT_METADATA_AUTHORS[${commit_sha_short}]="@${authors[${commit_sha_long}]}"
if [[ -n ${author} ]]; then
COMMIT_METADATA_AUTHORS[${commit_sha_short}]="@${author}"
fi
# Create humanized titles where possible, examples:

View File

@ -147,7 +147,6 @@ for commit in "${commits[@]}"; do
title="${title} (${commit})"
fi
line="- ${title}"
line=${line//) (/, )}
if [[ -v COMMIT_METADATA_AUTHORS[${commit}] ]]; then
line+=" (${COMMIT_METADATA_AUTHORS[${commit}]})"
fi