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

[gh]: Fix Release Creation if Changelog.md to long (#2752)

This commit is contained in:
CanbiZ 2025-03-01 10:26:12 +01:00 committed by GitHub
parent d82c9a24a7
commit 843c4f8c1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,10 @@ jobs:
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
YESTERDAY_CHANGELOG_NOTES=$(awk '/^## '"$YESTERDAY"'/ {f=1; next} f && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {f=0} f && !/^## / {print}' CHANGELOG.md)
if [ -n "$YESTERDAY_CHANGELOG_NOTES" ]; then
if [ ${#YESTERDAY_CHANGELOG_NOTES} -gt 10000 ]; then
echo "Changelog is too large, saving to file..."
echo "$YESTERDAY_CHANGELOG_NOTES" > changelog_tmp.md
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md --latest
elif [ -n "$YESTERDAY_CHANGELOG_NOTES" ]; then
gh release create "$YESTERDAY" -t "$YESTERDAY" -n "$YESTERDAY_CHANGELOG_NOTES" --latest
fi