@@ -689,14 +689,14 @@ jobs:
689689 # Search PR with that SHA
690690 # Load description of that PR
691691 printf "Read second parent of current SHA (%s) ... " "${{ github.ref }}"
692- FATHER_SHA=$(git rev-parse ${{ github.ref }}^2 -- 2> /dev/null)
692+ FATHER_SHA=$(git rev-parse ${{ github.ref }}^2 2> /dev/null)
693693 if [[ $? -ne 0 || "{FATHER_SHA}" == "" ]]; then
694694 printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
695695 printf "→ ${ANSI_LIGHT_YELLOW}Skipped readout of pull request description. This is not a merge commit.${ANSI_NOCOLOR}\n"
696696 else
697697 printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
698698
699- printf "Search Pull Request to '%s' and branch containing SHA %s ... " "${{ inputs.release_branch }}" "${FATHER_SHA}"
699+ printf "Search pull-request to '%s' and branch containing SHA %s ... " "${{ inputs.release_branch }}" "${FATHER_SHA}"
700700 PULL_REQUESTS=$(gh pr list --base "${{ inputs.release_branch }}" --search "${FATHER_SHA}" --state "merged" --json "title,number,mergedBy,mergedAt,body")
701701 if [[ $? -ne 0 || "${PULL_REQUESTS}" == "" ]]; then
702702 printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
@@ -719,7 +719,9 @@ jobs:
719719 printf " %s\n" "MergedAt: ${PR_MERGED_AT} ($(date -d"${PR_MERGED_AT}" '+%d.%m.%Y - %H:%M:%S'))"
720720 fi
721721
722+ printf "Write pull-request body of '%s' to '__PULLREQUEST__.md' ... " "${PR_TITLE}"
722723 printf "%s\n" "${PR_BODY}" > __PULLREQUEST__.md
724+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
723725 fi
724726
725727 # Check if a release description file should be used and exists.
@@ -757,51 +759,64 @@ jobs:
757759 NOTES=$(<__NOTES__.md)
758760
759761 # Inline description
762+ printf -- "Inline '__DESCRIPTION__.md' ... "
760763 if [[ -s __DESCRIPTION__.md ]]; then
761- NOTES="${NOTES//%%DESCRIPTION%%/$(<__DESCRIPTION__.md)}"
764+ NOTES="${NOTES//%%DESCRIPTION%%/$(cat __DESCRIPTION__.md | sed 's/&/\\&/g')}"
765+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
762766 else
763767 NOTES="${NOTES//%%DESCRIPTION%%/}"
768+ printf "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n"
764769 fi
765770
766771 # Inline PullRequest and increase headline levels
772+ printf -- "Inline '__PULLREQUEST__.md' ... "
767773 if [[ -s __PULLREQUEST__.md ]]; then
768774 while [[ "${NOTES}" =~ %%(PULLREQUEST(\+[0-3])?)%% ]]; do
769775 case "${BASH_REMATCH[1]}" in
770776 "PULLREQUEST+0" | "PULLREQUEST")
771- NOTES="${NOTES//${BASH_REMATCH[0]}/$(< __PULLREQUEST__.md)}"
777+ NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed 's/&/\\&/g' )}"
772778 ;;
773779 "PULLREQUEST+1")
774- NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1# /gm;t')}"
780+ NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1# /gm;t' | sed 's/&/\\&/g' )}"
775781 ;;
776782 "PULLREQUEST+2")
777- NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1### /gm;t')}"
783+ NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1## /gm;t' | sed 's/&/\\&/g ')}"
778784 ;;
779785 "PULLREQUEST+3")
780- NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1### /gm;t')}"
786+ NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1### /gm;t' | sed 's/&/\\&/g' )}"
781787 ;;
782788 esac
783789 done
790+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
784791 else
785792 while [[ "${NOTES}" =~ %%(PULLREQUEST(\+[0-3])?)%% ]]; do
786793 NOTES="${NOTES//${BASH_REMATCH[0]}/}"
787794 done
795+ printf "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n"
788796 fi
789797
790798 # Inline Files table
799+ printf -- "Inline '__ASSETS__.md' ... "
791800 if [[ -s __ASSETS__.md ]]; then
792- NOTES="${NOTES//%%ASSETS%%/$(<__ASSETS__.md)}"
801+ NOTES="${NOTES//%%ASSETS%%/$(cat __ASSETS__.md | sed 's/&/\\&/g')}"
802+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
793803 else
794804 NOTES="${NOTES//%%ASSETS%%/}"
805+ printf "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n"
795806 fi
796807
797808 # Inline Footer
809+ printf -- "Inline '__FOOTER__.md' ... "
798810 if [[ -s __FOOTER__.md ]]; then
799- NOTES="${NOTES//%%FOOTER%%/$(<__FOOTER__.md)}"
811+ NOTES="${NOTES//%%FOOTER%%/$(cat __FOOTER__.md | sed 's/&/\\&/g')}"
812+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
800813 else
801814 NOTES="${NOTES//%%FOOTER%%/}"
815+ printf "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n"
802816 fi
803817
804818 # Apply replacements
819+ printf -- "Apply replacements ... "
805820 while IFS=$'\r\n' read -r patternLine; do
806821 # skip empty lines
807822 [[ "$patternLine" == "" ]] && continue
@@ -810,12 +825,14 @@ jobs:
810825 replacement="${patternLine#*=}"
811826 NOTES="${NOTES//$pattern/$replacement}"
812827 done <<<'${{ inputs.replacements }}'
828+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
813829
814830 # Workarounds for stupid GitHub variables
815831 owner_repo="${{ github.repository }}"
816832 repo=${owner_repo##*/}
817833
818834 # Replace special identifiers
835+ printf -- "Replace GitHub variables ... "
819836 NOTES="${NOTES//%%gh_server%%/${{ github.server_url }}}"
820837 NOTES="${NOTES//%%gh_workflow_name%%/${{ github.workflow }}}"
821838 NOTES="${NOTES//%%gh_owner%%/${{ github.repository_owner }}}"
@@ -828,9 +845,12 @@ jobs:
828845 NOTES="${NOTES//%%date%%/$(date '+%Y-%m-%d')}"
829846 NOTES="${NOTES//%%time%%/$(date '+%H:%M:%S %Z')}"
830847 NOTES="${NOTES//%%datetime%%/$(date '+%Y-%m-%d %H:%M:%S %Z')}"
848+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
831849
832850 # Write final release notes to file
851+ printf "Write final release note '__NOTES__.md' ... "
833852 printf "%s\n" "${NOTES}" > __NOTES__.md
853+ printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
834854
835855 # Display partial contents for debugging
836856 if [[ -s __DESCRIPTION__.md ]]; then
0 commit comments