Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .github/workflows/release-sdk-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,28 +403,25 @@ jobs:
echo ""
} > "${NOTES_FILE}"

NOTES_START_TAG_ARG=""
GENERATE_NOTES_FLAG="--generate-notes"
if [[ -n "${PREVIOUS_RELEASE_TAG}" ]]; then
PREVIOUS_NOTES=$(gh release view "sdk-python-${PREVIOUS_RELEASE_TAG}" --json body -q '.body' 2>&1) || {
ERR_MSG="${PREVIOUS_NOTES}"
case "${ERR_MSG}" in
*"release not found"*|*"Not Found"*|*"HTTP 404"*)
PREVIOUS_NOTES='See commit history for changes.'
;;
*)
echo "::warning::Failed to fetch previous release notes: ${ERR_MSG}"
PREVIOUS_NOTES='See commit history for changes.'
;;
esac
}
printf '%s\n' "${PREVIOUS_NOTES}" >> "${NOTES_FILE}"
# --notes-start-tag replaces the old gh release view fetch;
# gh release create handles missing tags with a clear error.
NOTES_START_TAG_ARG="--notes-start-tag sdk-python-${PREVIOUS_RELEASE_TAG}"
Comment thread
doudouOUC marked this conversation as resolved.
Resolved
else
# PREVIOUS_RELEASE_TAG is only computed for stable releases.
# For preview/nightly, skip --generate-notes to avoid including non-SDK commits.
GENERATE_NOTES_FLAG=""
echo "See commit history for changes." >> "${NOTES_FILE}"
fi

gh release create "${TAG_NAME}" \
--target "${RELEASE_TARGET_SHA}" \
--title "SDK Python Release ${RELEASE_TAG}" \
--notes-file "${NOTES_FILE}" \
${GENERATE_NOTES_FLAG} \
${NOTES_START_TAG_ARG} \
${PRERELEASE_FLAG}

rm -f "${NOTES_FILE}"
Expand Down
Loading