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 "$@"