Skip to content

Commit 86bbf4a

Browse files
committed
Fix calcualtion of previous tag for release note generation
We used to generate release notes after tagging, so it was possible to just list the tags and pick the one before the current. This is no longer the case. Now we need to add the upcoming tag to the list since we generate the release notes before creating the tag. Signed-off-by: Lennart Jern <[email protected]>
1 parent 60385da commit 86bbf4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ staging-manifests:
452452
ifneq (,$(findstring -,$(RELEASE_TAG)))
453453
PRE_RELEASE=true
454454
endif
455-
PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null)
455+
# List all tags, add the new tag to the list, sort and pick the previous one.
456+
PREVIOUS_TAG ?= $(shell (git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$"; echo "$(RELEASE_TAG)") | sort -V | grep -B1 "^$(RELEASE_TAG)$$" | grep -v "^$(RELEASE_TAG)$$" | head -n 1 2>/dev/null)
456457
## set by Prow, ref name of the base branch, e.g., main
457458
RELEASE_DIR := out
458459
RELEASE_NOTES_DIR := releasenotes

0 commit comments

Comments
 (0)