Skip to content
Open
Changes from all 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
16 changes: 15 additions & 1 deletion medcat-v2/.release/prepare_patch_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,22 @@ if $DRY_RUN; then
git checkout "$ORIGINAL_REF" >/dev/null 2>&1 || error_exit "Could not return to original branch"
fi

# Validate cherry-pick hashes
if [[ ${#CHERRYPICK_HASHES[@]} -eq 0 ]]; then
echo "EMPTY"
# Allow empty list only if this is a .0 release and a prerelease exists
if [[ "$VERSION_PATCH" == "0" ]]; then
if ! git tag -l "medcat/v${VERSION_MAJOR_MINOR}.0[a-z]*" | grep -q .; then
error_exit "No cherry-pick hashes provided for $VERSION — expected at least one unless this is a .0 release after a pre-release."
fi
else
error_exit "No cherry-pick hashes provided for $VERSION — expected at least one for patch releases."
fi
fi


# do the cherry-picking
for HASH in "${CHERRYPICK_HASHES[@]}"; do
for HASH in "${CHERRYPICK_HASHES[@]-}"; do
if ! run_or_echo git cherry-pick "$HASH"; then
echo "Conflict detected when cherry-picking $HASH."
echo
Expand Down
Loading