fix(ci): build changelog from last stable release tag
This commit is contained in:
parent
fcf8d71349
commit
1c40546f3f
1 changed files with 10 additions and 4 deletions
|
|
@ -26,13 +26,19 @@ jobs:
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
current_tag="${GITHUB_REF_NAME}"
|
current_tag="${GITHUB_REF_NAME}"
|
||||||
previous_tag=""
|
previous_stable_tag=""
|
||||||
|
|
||||||
if previous_tag="$(git describe --tags --abbrev=0 "${current_tag}^" 2>/dev/null)"; then
|
if previous_stable_tag="$(
|
||||||
range="${previous_tag}..${current_tag}"
|
git describe --tags --abbrev=0 \
|
||||||
|
--exclude '*-rc*' \
|
||||||
|
--exclude '*-beta*' \
|
||||||
|
--exclude '*-alpha*' \
|
||||||
|
"${current_tag}^" 2>/dev/null
|
||||||
|
)"; then
|
||||||
|
range="${previous_stable_tag}..${current_tag}"
|
||||||
{
|
{
|
||||||
printf '## Changelog\n\n'
|
printf '## Changelog\n\n'
|
||||||
printf 'Changes since `%s`.\n\n' "${previous_tag}"
|
printf 'Changes since `%s`.\n\n' "${previous_stable_tag}"
|
||||||
git log --reverse --pretty=format:'- %h %s' "${range}"
|
git log --reverse --pretty=format:'- %h %s' "${range}"
|
||||||
printf '\n'
|
printf '\n'
|
||||||
} >CHANGELOG.md
|
} >CHANGELOG.md
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue