mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-18 20:08:23 +01:00
Credit script authors and list services and website changes in the changelog (#18809)
New scripts take their authors from the Author header. Pull requests of services and the website are collected like those of core. Releases mention contributors, are no longer cut at 5000 characters, link the compare view, and are skipped on days without changes.
This commit is contained in:
1 parent
3399d27109
commit
dd78778911
3 files changed
+172
-64
No files matched your search
Generated
+25
-3
@@ -19,6 +19,7 @@ jobs:
|
||||
run: sed -n '/^## /,$p' CHANGELOG.md > changelog_cleaned.md
|
||||
|
||||
- name: Extract relevant changelog section
|
||||
id: extract
|
||||
run: |
|
||||
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||
echo "Checking for changes on: $YESTERDAY"
|
||||
@@ -26,8 +27,24 @@ jobs:
|
||||
# Extract the section from "## $YESTERDAY" until the next "## YYYY-MM-DD"
|
||||
sed -n "/^## $YESTERDAY/,/^## [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/p" changelog_cleaned.md | head -n -1 > changelog_tmp_full.md
|
||||
|
||||
# Truncate the extracted section to 5000 characters
|
||||
head -c 5000 changelog_tmp_full.md > changelog_tmp.md
|
||||
# GitHub fills a release's Contributors only from bare @login mentions
|
||||
sed -i -E 's#\[@([A-Za-z0-9-]+)\]\(https://github\.com/\1\)#@\1#g' changelog_tmp_full.md
|
||||
|
||||
# Keep whole lines up to 120000 characters (GitHub allows 125000)
|
||||
export LC_ALL=C.UTF-8
|
||||
SIZE=0
|
||||
TRUNCATED=false
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
SIZE=$((SIZE + ${#line} + 1))
|
||||
if [ "$SIZE" -gt 120000 ]; then
|
||||
TRUNCATED=true
|
||||
break
|
||||
fi
|
||||
printf '%s\n' "$line"
|
||||
done < changelog_tmp_full.md > changelog_tmp.md
|
||||
if [ "$TRUNCATED" = true ]; then
|
||||
printf '\nCut to fit the release size limit. The full list is in [CHANGELOG.md](https://github.com/community-scripts/ProxmoxVE/blob/main/CHANGELOG.md).\n' >> changelog_tmp.md
|
||||
fi
|
||||
|
||||
echo "=== Extracted Changelog ==="
|
||||
cat changelog_tmp.md
|
||||
@@ -36,12 +53,17 @@ jobs:
|
||||
# Abort if no content was found
|
||||
if [ ! -s changelog_tmp.md ]; then
|
||||
echo "No changes found for $YESTERDAY, skipping release."
|
||||
exit 0
|
||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Create GitHub release
|
||||
if: steps.extract.outputs.skip != 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||
PREVIOUS=$(gh release view --json tagName --jq .tagName 2>/dev/null || true)
|
||||
if [ -n "$PREVIOUS" ]; then
|
||||
printf '\n**Full Changelog**: https://github.com/community-scripts/ProxmoxVE/compare/%s...%s\n' "$PREVIOUS" "$YESTERDAY" >> changelog_tmp.md
|
||||
fi
|
||||
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
|
||||
Reference in new issue
Block a user