Skip to content

Commit a748809

Browse files
committed
Report progress when assembling release notes text.
1 parent 86d1140 commit a748809

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/PublishReleaseNotes.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ jobs:
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,13 +759,17 @@ jobs:
757759
NOTES=$(<__NOTES__.md)
758760
759761
# Inline description
762+
printf -- "Inline '__DESCRIPTION__.md' ... "
760763
if [[ -s __DESCRIPTION__.md ]]; then
761764
NOTES="${NOTES//%%DESCRIPTION%%/$(<__DESCRIPTION__.md)}"
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
@@ -781,27 +787,36 @@ jobs:
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
792801
NOTES="${NOTES//%%ASSETS%%/$(<__ASSETS__.md)}"
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
799811
NOTES="${NOTES//%%FOOTER%%/$(<__FOOTER__.md)}"
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

Comments
 (0)