Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 3m28s
Some checks failed
Release / release (push) Failing after 3m28s
This commit is contained in:
parent
0cd637fb20
commit
511e09fb86
1 changed files with 27 additions and 5 deletions
|
@ -116,9 +116,31 @@ jobs:
|
|||
VERSION="${{ steps.version.outputs.release_version }}"
|
||||
FORGEJO_API="https://git.oguerreiro.com/api/v1"
|
||||
|
||||
echo "Fetching latest release date..."
|
||||
LAST_TAG_DATE=$(curl -s -H "Authorization: token $TOKEN" \
|
||||
"$FORGEJO_API/repos/$OWNER/$REPO/releases" | jq -r '.[0].created_at')
|
||||
echo "Fetching latest release tag..."
|
||||
LATEST_TAG=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/tags" \
|
||||
| jq -r '.[0].name')
|
||||
|
||||
if [[ -z "$LATEST_TAG" || "$LATEST_TAG" == "null" ]]; then
|
||||
echo "No previous tags found. Assuming first release."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
echo "Latest tag is: $LATEST_TAG"
|
||||
|
||||
# Get ISO timestamp of the latest tag commit
|
||||
COMMIT_DATE=$(git log -1 --format=%cI "$LATEST_TAG")
|
||||
echo "Fetching closed issues since $COMMIT_DATE..."
|
||||
|
||||
CLOSED_ISSUES_JSON=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$COMMIT_DATE")
|
||||
|
||||
if [[ -z "$CLOSED_ISSUES_JSON" ]]; then
|
||||
echo "Warning: No closed issues or invalid response."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
CLOSED_ISSUES=$(echo "$CLOSED_ISSUES_JSON" | jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Fetching closed issues since $LAST_TAG_DATE..."
|
||||
# Get closed issues since last tag (if any)
|
||||
|
@ -130,7 +152,7 @@ jobs:
|
|||
CLOSED_ISSUES=""
|
||||
fi
|
||||
|
||||
# Build release notes with proper line breaks
|
||||
# Build release notes markdown
|
||||
{
|
||||
echo "## Release v$VERSION"
|
||||
echo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue