Skip to content

Commit c470da2

Browse files
authored
Merge pull request kubernetes-sigs#5440 from nrb/doc-prev-tag-calculation
🌱 Document how previous versions are found
2 parents eeb7de2 + 7789d4a commit c470da2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/release.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
- name: Set version info
2525
run: |
2626
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
27-
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
27+
# NB: this gets the closest tag cut from the same branch; for new minor tags, it will find the previous minor, not the previous patch release
28+
# (for example v2.7.0, not v2.7.3). For new patch releases, it should fetch the previous patch (e.g. 2.7.3, not v2.7.0)
29+
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
2830
echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV
2931
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
3032
- name: Run release

0 commit comments

Comments
 (0)