From 8a15e963ef806acdfa20f84d66680b144446e777 Mon Sep 17 00:00:00 2001
From: Henry Lee <gbvrcx@gmail.com>
Date: Thu, 30 Nov 2023 11:13:30 +0900
Subject: [PATCH] chore(cicd): fix how to find base image projects

---
 .github/workflows/check.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index c278ae845..f1e29bcf2 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -74,9 +74,8 @@ jobs:
       - name: Check if base image exists
         id: check-if-base-image-exists
         run: |
-          lang=$(echo ${{ matrix.target }} | cut -d '/' -f 1)
-          proj=$(echo ${{ matrix.target }} | cut -d '/' -f 2 | cut -d '-' -f 1)
-          ls ${lang}-base/${proj}
+          lang=$(echo ${{ matrix.target }} | cut -d'/' -f1)
+          proj=$(echo ${{ matrix.target }} | cut -d'/' -f2 | rev | cut-d'-' -f2- | rev)
           if [ -d ${lang}-base/${proj} ]; then
             echo "base=${lang}-base/${proj}" >> ${GITHUB_OUTPUT}
             echo "image=${lang}-base:${proj}" | tr '[:upper:]' '[:lower:]' >> ${GITHUB_OUTPUT}