mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-03-08 13:19:05 +00:00
[gh] better handling of create changelog (#2818)
This commit is contained in:
parent
cc9075a14b
commit
b7968becc3
18
.github/workflows/github-release.yml
vendored
18
.github/workflows/github-release.yml
vendored
@ -23,20 +23,12 @@ jobs:
|
|||||||
cat changelog_cropped.md
|
cat changelog_cropped.md
|
||||||
echo "========================="
|
echo "========================="
|
||||||
|
|
||||||
- name: Parse CHANGELOG.md and create release
|
- name: Extract relevant changelog section
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||||
echo "Checking for changes on: $YESTERDAY"
|
echo "Checking for changes on: $YESTERDAY"
|
||||||
|
|
||||||
# Ensure yesterday's date exists in the changelog
|
# Extract relevant section from cropped changelog
|
||||||
if ! grep -q "## $YESTERDAY" changelog_cropped.md; then
|
|
||||||
echo "No entry found for $YESTERDAY, skipping release."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract section for yesterday's date
|
|
||||||
awk -v date="## $YESTERDAY" '
|
awk -v date="## $YESTERDAY" '
|
||||||
$0 ~ date {found=1; next}
|
$0 ~ date {found=1; next}
|
||||||
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit}
|
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit}
|
||||||
@ -53,5 +45,9 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create GitHub release
|
- name: Create GitHub release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||||
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
|
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
|
||||||
|
Loading…
x
Reference in New Issue
Block a user