1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

fix Release wf

This commit is contained in:
CanbiZ 2025-03-01 13:28:57 +01:00 committed by GitHub
parent 6aa2057202
commit 01e8f413ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,12 +20,16 @@ jobs:
run: | run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d) YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
# Extract the changelog section for YESTERDAY, stopping at the next date # Crop the changelog first (keep first 20,000 characters)
MAX_SIZE=20000
head -c "$MAX_SIZE" CHANGELOG.md > changelog_cropped.md
# Extract exactly the section for YESTERDAY, stopping at the next date
awk -v date="## $YESTERDAY" ' awk -v date="## $YESTERDAY" '
$0 ~ date {found=1; print; next} $0 ~ date {found=1}
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit} found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ && $0 != date {exit}
found {print} found
' CHANGELOG.md | sed '/^## [0-9]/d' > changelog_tmp.md ' changelog_cropped.md > changelog_tmp.md
echo "=== Extracted Changelog ===" echo "=== Extracted Changelog ==="
cat changelog_tmp.md cat changelog_tmp.md
@ -36,16 +40,5 @@ jobs:
exit 0 exit 0
fi fi
CHANGELOG_SIZE=$(wc -c < changelog_tmp.md)
echo "Changelog size: $CHANGELOG_SIZE bytes"
# Crop to first 20,000 characters if too large
MAX_SIZE=20000
if [ "$CHANGELOG_SIZE" -gt "$MAX_SIZE" ]; then
echo "WARNING: Changelog too large, cropping to first $MAX_SIZE characters..."
head -c "$MAX_SIZE" changelog_tmp.md > changelog_cropped.md
mv changelog_cropped.md changelog_tmp.md
fi
echo "Creating GitHub release for $YESTERDAY..." echo "Creating GitHub release for $YESTERDAY..."
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md