mirror of
https://github.com/nikaiw/VMkatz
synced 2026-09-25 07:51:06 +00:00
Skip prerelease tags in changelog for stable releases
This commit is contained in:
@@ -150,14 +150,21 @@ jobs:
|
|||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
run: |
|
run: |
|
||||||
# Find the previous tag
|
CURRENT_TAG="${{ github.ref_name }}"
|
||||||
PREV_TAG=$(git tag --sort=-v:refname | grep -v "${{ github.ref_name }}" | head -1)
|
# If the current tag is a prerelease (rc/beta/alpha), include previous
|
||||||
|
# prereleases in the history. Otherwise, skip prereleases so the
|
||||||
|
# changelog for a final release spans back to the last stable tag.
|
||||||
|
if echo "$CURRENT_TAG" | grep -qE -- "-(beta|alpha|rc)"; then
|
||||||
|
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${CURRENT_TAG}$" | head -1)
|
||||||
|
else
|
||||||
|
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${CURRENT_TAG}$" | grep -v -E -- "-(beta|alpha|rc)" | head -1)
|
||||||
|
fi
|
||||||
if [ -z "$PREV_TAG" ]; then
|
if [ -z "$PREV_TAG" ]; then
|
||||||
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
|
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
|
||||||
fi
|
fi
|
||||||
echo "## Changes since ${PREV_TAG}" > CHANGELOG.md
|
echo "## Changes since ${PREV_TAG}" > CHANGELOG.md
|
||||||
echo "" >> CHANGELOG.md
|
echo "" >> CHANGELOG.md
|
||||||
git log --pretty=format:"- %s" "${PREV_TAG}..${{ github.ref_name }}" >> CHANGELOG.md
|
git log --pretty=format:"- %s" "${PREV_TAG}..${CURRENT_TAG}" >> CHANGELOG.md
|
||||||
echo "" >> CHANGELOG.md
|
echo "" >> CHANGELOG.md
|
||||||
|
|
||||||
- name: Publish GitHub Release
|
- name: Publish GitHub Release
|
||||||
|
|||||||
Reference in New Issue
Block a user