From 7eb43eee9c5777a5172524dc72a5062c9464d062 Mon Sep 17 00:00:00 2001 From: Niall Byrne <9848926+niall-byrne@users.noreply.github.com> Date: Sat, 4 Mar 2023 10:19:37 -0500 Subject: [PATCH] ci(GITHUB): switch to conventional-changelog-cli --- .../.github/scripts/changelog.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/scripts/changelog.sh b/{{cookiecutter.project_slug}}/.github/scripts/changelog.sh index 2e9dfee6..982b1bc1 100644 --- a/{{cookiecutter.project_slug}}/.github/scripts/changelog.sh +++ b/{{cookiecutter.project_slug}}/.github/scripts/changelog.sh @@ -1,9 +1,9 @@ #!/bin/bash # .github/scripts/changelog.sh -# Generates a changelog based off the diff between $TAG and the previous sequential tag. +# Generates a changelog for the specified ${BRANCH_OR_TAG}. -# TAG: The new git tag the changelog is being generated for. +# BRANCH_OR_TAG: The new git tag the changelog is being generated for. # CI only script @@ -11,10 +11,7 @@ set -eo pipefail main() { - echo "{}" > package.json - - TAG="$(git tag -l --sort=refname | grep -E "[0-9]+\.[0-9]+\.[0-9]+" | tail -n 2 | head -n 1)" - CHANGE_LOG_CONTENT="$(npx -q generate-changelog -f - -t "${TAG}")" + CHANGE_LOG_CONTENT="$(npx -q conventional-changelog-cli -t "${BRANCH_OR_TAG}")" { echo "CHANGE_LOG_CONTENT<> "${GITHUB_ENV}" - rm package.json - } main "$@"