From 37c5b0eb110973e056029cc1650da64486bd8da6 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 26 Dec 2020 10:58:23 -0800 Subject: [PATCH] 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. --- .github/workflows/changelog.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 62cf0408..5d18ca9d 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -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