Fixes to changelog generator (#1127)

* Fix version header detection in changelog

This updates the regex to find the version header in our changelog.
There was a bug that affected patch, alpha, and beta versions. For
example, if we were looking for "v2.5" we might find "v2.5.1" or
"v2.5.1-alpha" or other versions like that.

This led to the changelog not being cleared properly on update, and old
versions sticking around longer than they should.

* re-add option to include author link for merged PRs in changelog

This option was accidentally left out when migrating the changelog
generator tool to github actions.

* fix conditional in changelog workflow

In github actions, booleans always end up as strings. So, it's not
enough to test `env.FULL_RELEASE` because both 'true' and 'false' will
evaluate as true. This fixes the conditional to check for the string
value 'true' instead of relying on a boolean.
This commit is contained in:
Jonathan Wren 2020-12-26 10:58:23 -08:00 committed by GitHub
parent 2f4ec7ca98
commit 37c5b0eb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ jobs:
- name: Prep changelog file (clear out old lines)
run: |
# delete the top of the changelog up to the correct tag
tagline=$(grep -n "^## \[\?${SINCE_TAG}\]\?" "$FILENAME" | awk '{print $1}' FS=':' | head -1)
tagline=$(grep -n "^## \[${SINCE_TAG}\]" "$FILENAME" | awk '{print $1}' FS=':' | head -1)
echo "tagline: ${tagline}"
if [[ -z $tagline ]]; then
@ -112,6 +112,7 @@ jobs:
releaseUrl: https://pypi.org/project/jrnl/%s/
releaseBranch: develop
verbose: false
author: true
- name: Small fixes
run: |
@ -139,7 +140,7 @@ jobs:
git push origin $BRANCH
- name: Merge to Release branch
if: env.FULL_RELEASE
if: env.FULL_RELEASE == 'true'
run: |
git checkout release
git merge --ff-only $BRANCH