File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -19,23 +19,18 @@ jobs:
19
19
echo "${{ github.event.issue.body }}"
20
20
echo "-------------------------------------------"
21
21
22
- - name : Extract values from issue body
22
+ - name : Extract values from issue title
23
23
id : vars
24
24
run : |
25
- cat << 'EOF' > body.txt
26
- ${{ github.event.issue.body }}
27
- EOF
25
+ title="${{ github.event.issue.title }}"
28
26
29
- echo "--------- RAW ISSUE BODY ---------"
30
- cat body.txt
31
- echo "----------------------------------"
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)
27
+ # Extract month and year using awk
28
+ month=$(echo "$title" | awk -F' : ' ' {print $2}' | awk '{print $1}')
29
+ year=$(echo "$title" | awk -F' : ' ' {print $2}' | awk '{print $2}')
36
30
37
31
if [ -z "$month" ] || [ -z "$year" ]; then
38
- echo "❌ Could not extract month or year from issue body."
32
+ echo "❌ Could not extract month or year from title."
33
+ echo "Title was : $title"
39
34
exit 1
40
35
fi
41
36
45
40
filename="_posts/${date}-newsletter.md"
46
41
47
42
echo "✅ Parsed values:"
43
+ echo " Title : $title"
48
44
echo " Month : $month"
49
45
echo " Year : $year"
50
46
echo " Month Num : $month_num"
You can’t perform that action at this time.
0 commit comments