@@ -22,35 +22,36 @@ jobs:
22
22
- name : Extract values from issue body
23
23
id : vars
24
24
run : |
25
- body="${{ github.event.issue.body }}"
26
-
25
+ cat << 'EOF' > body.txt
26
+ ${{ github.event.issue.body }}
27
+ EOF
28
+
27
29
echo "--------- RAW ISSUE BODY ---------"
28
- echo "$ body"
30
+ cat body.txt
29
31
echo "----------------------------------"
30
-
31
- # Parse the body using reliable pattern matching
32
- month=$(echo "$body" | awk '/### Newsletter Month/ {getline; print}' | xargs)
33
- year=$(echo "$body" | awk '/### Newsletter Year/ {getline; print}' | xargs)
34
-
32
+
33
+ # Parse using awk from the saved file
34
+ month=$(awk '/### Newsletter Month/ {getline; print}' body.txt | xargs)
35
+ year=$(awk '/### Newsletter Year/ {getline; print}' body.txt | xargs)
36
+
35
37
if [ -z "$month" ] || [ -z "$year" ]; then
36
38
echo "❌ Could not extract month or year from issue body."
37
39
exit 1
38
40
fi
39
-
40
- # Convert month name to number
41
+
41
42
month_num=$(date -d "$month 1" '+%m')
42
43
date="${year}-${month_num}-01"
43
44
branch="feature/newsletter-${year}-${month_num}"
44
45
filename="_posts/${date}-newsletter.md"
45
-
46
+
46
47
echo "✅ Parsed values:"
47
48
echo " Month : $month"
48
49
echo " Year : $year"
49
50
echo " Month Num : $month_num"
50
51
echo " Date : $date"
51
52
echo " Branch : $branch"
52
53
echo " Filename : $filename"
53
-
54
+
54
55
echo "month=$month" >> $GITHUB_OUTPUT
55
56
echo "month_num=$month_num" >> $GITHUB_OUTPUT
56
57
echo "year=$year" >> $GITHUB_OUTPUT
0 commit comments