From bc33b97de1e63d4cbdfb214f7ef3f9fdcba22b82 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Tue, 10 May 2022 09:46:07 -0400 Subject: [PATCH] Stop auto-release changelogs from being too huge --- .github/workflows/release-automation.yml | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-automation.yml b/.github/workflows/release-automation.yml index 2b888a9ff2a9..69932580909b 100644 --- a/.github/workflows/release-automation.yml +++ b/.github/workflows/release-automation.yml @@ -37,16 +37,21 @@ jobs: PREVIOUS_RELEASE_TAG=$(git tag --list iceraven-* --sort=-creatordate | tail -n+2 | head -n 1) echo "## Automated release of version ${{ github.event.ref }} browser" >>temp_changelog.md - echo "
" >>temp_changelog.md - echo "Click to expand" >>temp_changelog.md - echo " " >>temp_changelog.md - echo "This is an automated release, consisting of the following changes:" >>temp_changelog.md - echo "### Change log (commit history since previous release)" >>temp_changelog.md - echo " " >>temp_changelog.md - git log ${{ github.event.ref }}...$PREVIOUS_RELEASE_TAG --pretty='format:%C(auto)%h (%as) %s' >>temp_changelog.md - echo " " >>temp_changelog.md - echo " " >>temp_changelog.md - echo "
" >>temp_changelog.md + if [[ "$(git log | grep $PREVIOUS_RELEASE_TAG | wc -l)" != "0" ]] ; then + # There's a path from the previous release to now + echo "
" >>temp_changelog.md + echo "Click to expand" >>temp_changelog.md + echo " " >>temp_changelog.md + echo "This is an automated release, consisting of the following changes:" >>temp_changelog.md + echo "### Change log (commit history since previous release)" >>temp_changelog.md + echo " " >>temp_changelog.md + git log ${{ github.event.ref }}...$PREVIOUS_RELEASE_TAG --pretty='format:%C(auto)%h (%as) %s' | head -n 1000 >>temp_changelog.md + echo " " >>temp_changelog.md + echo " " >>temp_changelog.md + echo "
" >>temp_changelog.md + else + echo "This is an automated release, not directly descended from the previous release." >>temp_changelog.md + fi echo "**NOTE**: @fork-maintainers, you can edit these auto-generated release notes with a more user-friendly summary of the key changes, if needed." >>temp_changelog.md echo " " >>temp_changelog.md