44 schedule :
55 - cron : ' 1 0 * * *' # Runs daily at 00:01 UTC
66 workflow_dispatch :
7-
7+
88jobs :
99 create-daily-release :
1010 runs-on : runner-cluster-htl-set
@@ -14,32 +14,25 @@ jobs:
1414 - name : Checkout repository
1515 uses : actions/checkout@v4
1616
17- - name : Extract first 5000 characters from CHANGELOG.md
18- run : head -c 5000 CHANGELOG.md > changelog_cropped.md
19-
20- - name : Debugging - Show extracted changelog
21- run : |
22- echo "=== CHANGELOG EXCERPT ==="
23- cat changelog_cropped.md
24- echo "========================="
17+ - name : Clean CHANGELOG (remove HTML header)
18+ run : sed -n '/^## /,$p' CHANGELOG.md > changelog_cleaned.md
2519
2620 - name : Extract relevant changelog section
2721 run : |
2822 YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
2923 echo "Checking for changes on: $YESTERDAY"
3024
31- # Extract relevant section from cropped changelog
32- awk -v date="## $YESTERDAY" '
33- $0 ~ date {found=1; next}
34- found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit}
35- found
36- ' changelog_cropped.md > changelog_tmp.md
25+ # Extract the section from "## $YESTERDAY" until the next "## YYYY-MM-DD"
26+ sed -n "/^## $YESTERDAY/,/^## [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/p" changelog_cleaned.md | head -n -1 > changelog_tmp_full.md
27+
28+ # Truncate the extracted section to 5000 characters
29+ head -c 5000 changelog_tmp_full.md > changelog_tmp.md
3730
3831 echo "=== Extracted Changelog ==="
3932 cat changelog_tmp.md
4033 echo "==========================="
4134
42- # Skip if no content was found
35+ # Abort if no content was found
4336 if [ ! -s changelog_tmp.md ]; then
4437 echo "No changes found for $YESTERDAY, skipping release."
4538 exit 0
0 commit comments