diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 816ac34..f47d791 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,11 +28,24 @@ jobs: java-version: 11 cache: gradle + # Set environment variables + - name: Export Properties + id: properties + shell: bash + run: | + CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d' + ${{ github.event.release.body }} + EOM + )" + + echo "::set-output name=changelog::$CHANGELOG" + # Update Unreleased section with the current release note - name: Patch Changelog + if: ${{ steps.properties.outputs.changelog != '' }} run: | ./gradlew patchChangelog --release-note "$(cat << 'EOM' - ${{ github.event.release.body }} + ${{ steps.properties.outputs.changelog }} EOM )" @@ -50,6 +63,7 @@ jobs: # Create pull request - name: Create Pull Request + if: ${{ steps.properties.outputs.changelog != '' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index f390fdd..7080100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `2` - GitHub Actions general performance refactoring - GitHub Actions - prepare plugin archive content to be archived once +- GitHub Actions - patch changelog only if change notes are provided - Update `pluginUntilBuild` to include `213.*` (2021.3.*) ### Fixed