From d9f4f74975f9613f47da3cc30c1c049d76341bf5 Mon Sep 17 00:00:00 2001 From: Daryl Todosichuk Date: Mon, 21 Oct 2024 21:00:08 -0700 Subject: [PATCH] Extract Major and Minor Version Using grep --- .github/workflows/docker-build-main.yml | 2 +- applications/scripts/datafix-ab#001.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-main.yml b/.github/workflows/docker-build-main.yml index f2df898..b1e9acc 100644 --- a/.github/workflows/docker-build-main.yml +++ b/.github/workflows/docker-build-main.yml @@ -68,7 +68,7 @@ jobs: id: tag-selector run: | # Extract the major and minor version parts - MAJOR_MINOR_VERSION=$(echo "${{env.RELEASE_VERSION}}" | sed 's/\.[0-9]*$//') + MAJOR_MINOR_VERSION=$(echo "${{env.RELEASE_VERSION}}" | grep -oE '^[0-9]+\.[0-9]+') # Extract the latest patch version for the given major.minor version VERSION_PATCH=$(git tag --list "${{env.RELEASE_PREFIX}}${MAJOR_MINOR_VERSION}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$') if [ -z "$VERSION_PATCH" ]; then diff --git a/applications/scripts/datafix-ab#001.sql b/applications/scripts/datafix-ab#001.sql index 1827ffa..824ac04 100644 --- a/applications/scripts/datafix-ab#001.sql +++ b/applications/scripts/datafix-ab#001.sql @@ -1,2 +1,3 @@ test1 -test2 \ No newline at end of file +test2 +test3 \ No newline at end of file