diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2017-01-10 15:25:29 +0000 |
---|---|---|
committer | Marcel Hlopko <hlopko@google.com> | 2017-01-10 15:53:27 +0000 |
commit | 9f915545df4ca6dae044b9e02186b3616ddf5418 (patch) | |
tree | 325887f971430a6e0472fe8e3417f006a7b7199e /scripts/release/release.sh | |
parent | 4b5cfe499cab2f956a4f53ce5e244ac8b80d5ec7 (diff) |
Fix formatting of the release CHANGELOG file
- Add backquotes around the changelog
- Add empty line at the end of the changelog
- Enforce the use of the master changelog prior to release
Fixes #2281.
--
Change-Id: I449f5209a6b05e65411a64ce82ea1d89d60ee4d3
Reviewed-on: https://cr.bazel.build/8044
PiperOrigin-RevId: 144080940
MOS_MIGRATED_REVID=144080940
Diffstat (limited to 'scripts/release/release.sh')
-rwxr-xr-x | scripts/release/release.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/release/release.sh b/scripts/release/release.sh index b8fb8474c0..988c497d6d 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -89,8 +89,13 @@ function release_note_editor() { # Create the release commit by changing the CHANGELOG file function create_release_commit() { - local infos=$(generate_release_message "${1}") + local infos=$(generate_release_message "${1}" HEAD '```') local changelog_path="$PWD/CHANGELOG.md" + local master=$(get_master_ref) + + # Get the changelog from master to avoid missing release notes + # from release that were in-between + git checkout -q ${master} CHANGELOG.md || true # CHANGELOG.md local tmpfile="$(mktemp ${TMPDIR:-/tmp}/relnotes-XXXXXXXX)" @@ -98,7 +103,9 @@ function create_release_commit() { echo -n "## ${infos}" >${tmpfile} if [ -f "${changelog_path}" ]; then echo >>${tmpfile} + echo >>${tmpfile} cat "${changelog_path}" >>${tmpfile} + echo >>${tmpfile} fi cat "${tmpfile}" > ${changelog_path} git add ${changelog_path} @@ -106,6 +113,7 @@ function create_release_commit() { trap - EXIT # Commit + infos="$(echo "${infos}" | grep -Ev '^```$')" git commit --no-verify -m "${infos}" --no-edit --author "${RELEASE_AUTHOR}" } |