From 1b63fb397e864e298014b8c6540b7fdae8db781a Mon Sep 17 00:00:00 2001 From: Nick Le Large Date: Thu, 21 Nov 2024 16:54:21 +0100 Subject: [PATCH] Keep spaces and newline characters when sanitizing the commit message --- .../bump-version-and-create-release-and-push-docker-images.yaml | 2 +- .github/workflows/compute_version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml index 427e29cb..8bb87e7a 100644 --- a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml +++ b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml @@ -24,7 +24,7 @@ jobs: PR_BODY: ${{ github.event.pull_request.body }} run: | source version - new_version=$(.github/workflows/compute_version.sh "$VERSION" "${PR_BODY//[^a-zA-Z0-9#]/}") + new_version=$(.github/workflows/compute_version.sh "$VERSION" "${PR_BODY//[^a-zA-Z0-9# $'\n']/}") echo "new_version=$new_version" >> $GITHUB_OUTPUT update-version-file: diff --git a/.github/workflows/compute_version.sh b/.github/workflows/compute_version.sh index feb3ee29..86e45372 100755 --- a/.github/workflows/compute_version.sh +++ b/.github/workflows/compute_version.sh @@ -8,7 +8,7 @@ if [[ $# -ne 2 ]]; then fi initial_version=${1//[^0-9.]/} -input_string=${2//[^a-zA-Z0-9#]/} +input_string=${2//[^a-zA-Z0-9# $'\n']/} initial_major=$(echo "$initial_version" | cut -d'.' -f1) initial_minor=$(echo "$initial_version" | cut -d'.' -f2)