@@ -45,32 +45,48 @@ jobs:
4545 in_changelog=0
4646 found_version=0
4747 release_notes=""
48+
49+ echo "DEBUG: Starting to extract release notes from $readme_file for version $plugin_version."
50+
4851 while IFS= read -r line; do
52+ echo "DEBUG: Processing line: $line"
53+
4954 # Start processing after the changelog header
5055 if [[ "$line" == "$changelog_section_start" ]]; then
5156 in_changelog=1
57+ echo "DEBUG: Found changelog section header."
5258 continue
5359 fi
5460
5561 # Skip if not in changelog section
5662 if [[ $in_changelog -eq 0 ]]; then
63+ echo "DEBUG: Skipping line (not in changelog section)."
5764 continue
5865 fi
5966
6067 # Check for the current version header
6168 if [[ "$line" == "= ${plugin_version} =" ]]; then
6269 found_version=1
70+ echo "DEBUG: Found version header for $plugin_version."
6371 continue
6472 fi
6573
66- # Stop when another version header is encountered
67- if [[ $found_version -eq 1 && "$line" =~ ^=.+=$ ]]; then
74+ # Break if a new version header is found after the current version
75+ if [[ $found_version -eq 1 && "$line" =~ ^\= [0-9]+\.[0-9]+\.[0-9]+ \=$ ]]; then
76+ echo "DEBUG: Found a new version header. Stopping collection."
6877 break
6978 fi
7079
7180 # Collect lines starting with '*' if we are in the current version section
7281 if [[ $found_version -eq 1 && "$line" =~ ^\* ]]; then
82+ echo "DEBUG: Found changelog entry: $line"
7383 release_notes+="${line}\n"
84+ continue
85+ fi
86+
87+ # Log skipped lines in the current version section
88+ if [[ $found_version -eq 1 ]]; then
89+ echo "DEBUG: Skipping line (not a changelog entry): $line"
7490 fi
7591 done < "$readme_file"
7692
@@ -79,11 +95,14 @@ jobs:
7995 exit 1
8096 fi
8197
98+ echo "DEBUG: Successfully extracted release notes."
99+ echo "DEBUG: Release notes content:"
100+ echo -e "$release_notes"
101+
82102 # Write the release notes with actual line breaks
83103 echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
84104 echo -e "$release_notes" >> $GITHUB_ENV
85- echo "EOF" >> $GITHUB_ENV
86-
105+ echo "EOF" >> $GITHUB_ENV
87106
88107 - name : Create zip file
89108 run : |
0 commit comments