Skip to content

Commit 39cf88b

Browse files
authored
Merge pull request #2860 from Nordix/lentzi90/fix-previous-tag-calculation
🌱 Fix calcualtion of previous tag for release note generation
2 parents ec3c3ce + 86bbf4a commit 39cf88b

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)