Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 3m15s
Some checks failed
Release / release (push) Failing after 3m15s
This commit is contained in:
parent
a27d2b6991
commit
0cd637fb20
1 changed files with 18 additions and 11 deletions
|
@ -121,19 +121,26 @@ jobs:
|
|||
"$FORGEJO_API/repos/$OWNER/$REPO/releases" | jq -r '.[0].created_at')
|
||||
|
||||
echo "Fetching closed issues since $LAST_TAG_DATE..."
|
||||
ISSUES=$(curl -s -H "Authorization: token $TOKEN" \
|
||||
"$FORGEJO_API/repos/$OWNER/$REPO/issues?state=closed&limit=100" | \
|
||||
jq -r --arg last_date "$LAST_TAG_DATE" '
|
||||
.[] | select(.closed_at > $last_date) |
|
||||
"- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
|
||||
if [ -z "$ISSUES" ]; then
|
||||
NOTES="## Release $VERSION\n\nNo issues closed since last release."
|
||||
# Get closed issues since last tag (if any)
|
||||
if [[ "$LATEST_TAG" != "null" && "$LATEST_TAG" != "v$VERSION" ]]; then
|
||||
CLOSED_ISSUES=$(curl -s -H "Authorization: token $TOKEN" \
|
||||
"$FORGEJO_API/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$(date -u -d "$(git log -1 --format=%cI $LATEST_TAG)" +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
| jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
else
|
||||
NOTES="## Release $VERSION\n\n### Closed Issues\n\n$ISSUES"
|
||||
CLOSED_ISSUES=""
|
||||
fi
|
||||
|
||||
echo "$NOTES" > release-notes.md
|
||||
# Build release notes with proper line breaks
|
||||
{
|
||||
echo "## Release v$VERSION"
|
||||
echo
|
||||
if [[ -n "$CLOSED_ISSUES" ]]; then
|
||||
echo "### Closed Issues"
|
||||
echo "$CLOSED_ISSUES"
|
||||
else
|
||||
echo "No issues closed since last release."
|
||||
fi
|
||||
} > release-notes.md
|
||||
cat release-notes.md
|
||||
|
||||
# Create the release
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue