Skip to content

Commit def6f2d

Browse files
committed
build: improve robustness of fallback version extraction
1 parent 9d07dbd commit def6f2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk-platform-java/.github/scripts/hermetic_library_generation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ if [[ "$current_branch" =~ ^release-please-- ]]; then
129129
echo "Detected release PR branch: $current_branch"
130130
if ! docker pull "${IMAGE_NAME}:${image_tag}"; then
131131
echo "Image not found for version ${image_tag}. Falling back to previous version from ${target_branch}."
132-
previous_tag=$(git show "${target_branch}":.github/workflows/hermetic_library_generation.yaml | grep "image_tag:" | cut -d ':' -f 2 | cut -d '#' -f 1 | xargs)
132+
previous_tag=$(git show "${target_branch}":.github/workflows/hermetic_library_generation.yaml | grep -m 1 "^[[:space:]]*image_tag:" | cut -d ':' -f 2- | cut -d '#' -f 1 | xargs)
133133
if [ -n "$previous_tag" ]; then
134134
echo "Using previous image version: $previous_tag"
135135
image_tag="$previous_tag"

0 commit comments

Comments
 (0)