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

Update github-release.yml

This commit is contained in:
CanbiZ 2025-03-01 10:30:57 +01:00 committed by GitHub
parent 8af885a0f3
commit c738615bf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,13 @@ name: Create new release
on:
schedule:
# Runs "At 00:01 every night" (UTC)
- cron: '1 0 * * *'
workflow_dispatch: # Allows manual execution
- cron: '1 0 * * *' # Runs nightly
workflow_dispatch:
inputs:
force_release:
description: "Bypass changelog size limit"
required: false
default: "false"
jobs:
create-new-release:
@ -18,6 +22,7 @@ jobs:
- name: Parse CHANGELOG.md for yesterday's entries and create a new release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_RELEASE: ${{ github.event.inputs.force_release }}
run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
awk '/^## '"$YESTERDAY"'/ {f=1; next} f && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {f=0} f && !/^## / {print}' CHANGELOG.md > changelog_tmp.md
@ -28,12 +33,13 @@ jobs:
fi
CHANGELOG_SIZE=$(wc -c < changelog_tmp.md)
echo "Changelog size: $CHANGELOG_SIZE bytes"
if [ "$CHANGELOG_SIZE" -gt 10000 ]; then
echo "ERROR: Changelog is too large to process automatically! Manual review required."
echo "To manually trigger the release, use the 'workflow_dispatch' event."
if [ "$CHANGELOG_SIZE" -gt 10000 ] && [ "$FORCE_RELEASE" != "true" ]; then
echo "ERROR: Changelog is too large! Manual review required."
echo "To manually trigger the release, use 'workflow_dispatch' with 'force_release: true'."
exit 1
fi
# Creating the GitHub release (without --latest)
echo "Creating GitHub release for $YESTERDAY..."
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md