Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 3m54s
Some checks failed
Release / release (push) Failing after 3m54s
This commit is contained in:
parent
02a5fac535
commit
08acf6949c
1 changed files with 25 additions and 7 deletions
|
@ -75,14 +75,32 @@ jobs:
|
||||||
else
|
else
|
||||||
echo "Latest tag is: $LATEST_TAG"
|
echo "Latest tag is: $LATEST_TAG"
|
||||||
|
|
||||||
# Get ISO timestamp of the latest tag commit
|
# Step 1: Get the tag ref object
|
||||||
LATEST_TAG_COMMIT_DATE=$(curl -sf -H "Authorization: token $TOKEN" \
|
TAG_REF=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/refs/tags/$LATEST_TAG" \
|
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/refs/tags/$LATEST_TAG")
|
||||||
| jq -r '.[0].object.sha' \
|
|
||||||
| xargs -I{} curl -sf -H "Authorization: token $TOKEN" \
|
# Extract the first .object.sha (if it's an array) or directly if it's an object
|
||||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/commits/{}" \
|
if echo "$TAG_REF" | jq -e 'type == "array"' >/dev/null; then
|
||||||
|
TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.[0].object.sha')
|
||||||
|
TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.[0].object.type')
|
||||||
|
else
|
||||||
|
TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.object.sha')
|
||||||
|
TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.object.type')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 2: If it's a tag object, resolve to commit
|
||||||
|
if [ "$TAG_OBJECT_TYPE" = "tag" ]; then
|
||||||
|
COMMIT_SHA=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||||
|
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/tags/$TAG_OBJECT_SHA" \
|
||||||
|
| jq -r '.object.sha')
|
||||||
|
else
|
||||||
|
COMMIT_SHA=$TAG_OBJECT_SHA
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 3: Get the commit date
|
||||||
|
COMMIT_DATE=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||||
|
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/commits/$COMMIT_SHA" \
|
||||||
| jq -r '.committer.date')
|
| jq -r '.committer.date')
|
||||||
COMMIT_DATE="$LATEST_TAG_COMMIT_DATE"
|
|
||||||
echo "Fetching closed issues since $COMMIT_DATE..."
|
echo "Fetching closed issues since $COMMIT_DATE..."
|
||||||
|
|
||||||
CLOSED_ISSUES_JSON=$(curl -sf -H "Authorization: token $TOKEN" \
|
CLOSED_ISSUES_JSON=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue