File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,24 @@ jobs:
16
16
- name : Extract values from issue body
17
17
id : vars
18
18
run : |
19
- month=$(echo "${{ github.event.issue.body }}" | grep -i "Newsletter Month" -A 1 | tail -n 1 | xargs)
20
- year=$(echo "${{ github.event.issue.body }}" | grep -i "Newsletter Year" -A 1 | tail -n 1 | xargs)
21
- # Convert month name to MM
19
+ body="${{ github.event.issue.body }}"
20
+
21
+ echo "Raw issue body:"
22
+ echo "$body"
23
+
24
+ month=$(echo "$body" | awk '/### Newsletter Month/ {getline; print}' | xargs)
25
+ year=$(echo "$body" | awk '/### Newsletter Year/ {getline; print}' | xargs)
26
+
27
+ if [ -z "$month" ] || [ -z "$year" ]; then
28
+ echo "❌ Could not extract month or year from issue body."
29
+ exit 1
30
+ fi
31
+
22
32
month_num=$(date -d "$month 1" '+%m')
23
33
date="${year}-${month_num}-01"
24
34
branch="feature/newsletter-${year}-${month_num}"
25
35
filename="_posts/${date}-newsletter.md"
26
-
36
+
27
37
echo "month=$month" >> $GITHUB_OUTPUT
28
38
echo "month_num=$month_num" >> $GITHUB_OUTPUT
29
39
echo "year=$year" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments