From 64fdfa847ae9289bba431ec3f63da19bd578ccac Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 5 Jun 2023 06:47:40 -0700 Subject: [PATCH] Fix error when script is run after the final tag is created. (This script is run at different points in the release process, including once after the tag is created to update the final release index page and GitHub release page.) PiperOrigin-RevId: 537860711 Change-Id: I6bf129c82eb2c83b37993d4ef691d4783c5735b6 --- scripts/release/relnotes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/release/relnotes.py b/scripts/release/relnotes.py index fcdfb86ef29135..da3c9fe1ad0678 100644 --- a/scripts/release/relnotes.py +++ b/scripts/release/relnotes.py @@ -171,13 +171,13 @@ def get_external_authors_between(base, head): is_major = bool(re.fullmatch(r"\d+.0.0", current_release)) tags = [tag for tag in git("tag", "--sort=refname") if "pre" not in tag] + + # Get the baseline for RCs (before release tag is created) if current_release not in tags: tags.append(current_release) - tags.sort() - last_release = tags[tags.index(current_release) - 1] - else: - print("Error: release tag already exists") - sys.exit(1) + + tags.sort() + last_release = tags[tags.index(current_release) - 1] # Assuming HEAD is on the current (to-be-released) release, find the merge # base with the last release so that we know which commits to generate notes