Skip to content

Commit 3822df8

Browse files
committed
Update release-notes-script.sh
1 parent 5d55499 commit 3822df8

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

docusaurus/release-notes-script.sh

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ main() {
173173

174174
# Initialize file
175175
rm -f "$OUTPUT_FILE"
176-
echo "## $MILESTONE_TITLE" > "$OUTPUT_FILE"
176+
177+
# Remove 'v' prefix from milestone title if present
178+
CLEAN_MILESTONE_TITLE=$(echo "$MILESTONE_TITLE" | sed 's/^v//')
179+
180+
echo "## $CLEAN_MILESTONE_TITLE" > "$OUTPUT_FILE"
181+
echo "" >> "$OUTPUT_FILE" # Empty line for readability in Markdown
182+
echo "<br />" >> "$OUTPUT_FILE"
177183

178184
# Fetch PRs
179185
prs=$(gh_api_get "issues?milestone=$MILESTONE&state=closed&pull_request")
@@ -202,37 +208,38 @@ main() {
202208
if [ -n "$section" ]; then
203209
# Determine source
204210
source="repo"
205-
if echo "$labels" | grep -q "source: Dev Docs"; then
206-
source="dev_docs"
207-
elif echo "$labels" | grep -q "source: User Guide"; then
208-
source="user_guide"
211+
if echo "$labels" | grep -q "source: CMS"; then
212+
source="cms"
209213
elif echo "$labels" | grep -q "source: Strapi Cloud"; then
210214
source="cloud"
211215
fi
212216

213217
# Create section file if it doesn't exist
214218
case "$section" in
215219
"new_content")
216-
echo "### <Icon name="sparkle" /> New content" > "$TEMP_DIR/${section}_header"
220+
echo "### <Icon name='sparkle' /> New content" > "$TEMP_DIR/${section}_header"
221+
echo "" >> "$TEMP_DIR/${section}_header" # Empty line for readability in Markdown
222+
echo "<br />" >> "$TEMP_DIR/${section}_header"
217223
;;
218224
"updated_content")
219-
echo "### <Icon name="pen-nib" /> Updated content" > "$TEMP_DIR/${section}_header"
225+
echo "### <Icon name='pen-nib' /> Updated content" > "$TEMP_DIR/${section}_header"
226+
echo "" >> "$TEMP_DIR/${section}_header" # Empty line for readability in Markdown
227+
echo "<br />" >> "$TEMP_DIR/${section}_header"
220228
;;
221229
"chore")
222-
echo "### <Icon name="pen-nib" /> Chore, fixes, typos, and other improvements" > "$TEMP_DIR/${section}_header"
230+
echo "### <Icon name='broom' /> Chore, fixes, typos, and other improvements" > "$TEMP_DIR/${section}_header"
231+
echo "" >> "$TEMP_DIR/${section}_header" # Empty line for readability in Markdown
232+
echo "<br />" >> "$TEMP_DIR/${section}_header"
223233
;;
224234
esac
225235

226236
# Create source file if it doesn't exist
227237
case "$source" in
228-
"dev_docs")
229-
echo "#### Dev Docs" > "$TEMP_DIR/${section}_${source}_header"
230-
;;
231-
"user_guide")
232-
echo "#### User Guide" > "$TEMP_DIR/${section}_${source}_header"
238+
"cms")
239+
echo "#### CMS" > "$TEMP_DIR/${section}_${source}_header"
233240
;;
234241
"cloud")
235-
echo "#### Strapi Cloud" > "$TEMP_DIR/${section}_${source}_header"
242+
echo "#### Cloud" > "$TEMP_DIR/${section}_${source}_header"
236243
;;
237244
"repo")
238245
echo "#### Repository" > "$TEMP_DIR/${section}_${source}_header"
@@ -253,7 +260,7 @@ main() {
253260
has_content=false
254261

255262
# Check if we have content for this section
256-
for source in "dev_docs" "user_guide" "cloud" "repo"; do
263+
for source in "cms" "cloud" "repo"; do
257264
if [ -f "$TEMP_DIR/${section}_${source}_content" ] && [ -s "$TEMP_DIR/${section}_${source}_content" ]; then
258265
has_content=true
259266
break
@@ -271,7 +278,7 @@ main() {
271278
cat "$TEMP_DIR/${section}_header" >> "$OUTPUT_FILE"
272279

273280
first_subsection=true
274-
for source in "dev_docs" "user_guide" "cloud" "repo"; do
281+
for source in "cms" "cloud" "repo"; do
275282
if [ -f "$TEMP_DIR/${section}_${source}_content" ] && [ -s "$TEMP_DIR/${section}_${source}_content" ]; then
276283
echo "" >> "$OUTPUT_FILE"
277284
cat "$TEMP_DIR/${section}_${source}_header" >> "$OUTPUT_FILE"

0 commit comments

Comments
 (0)