From c9a0ee4251af63dc432d4d6ccc86586ddf90f87f Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Fri, 9 Feb 2024 10:47:12 -0800 Subject: [PATCH] Fix Docker and Package tests (#247) Added better regex matching of file paths. Also remove whitespace from the path Signed-off-by: Mike Chang --- .github/workflows/build-package.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-package.yaml b/.github/workflows/build-package.yaml index 0bed29a6..2ecc4461 100644 --- a/.github/workflows/build-package.yaml +++ b/.github/workflows/build-package.yaml @@ -53,8 +53,8 @@ jobs: --exit-code -a --no-prefix -- $FILE | egrep "^\+") PACKAGE=$(echo $DIFF | cut -d'"' -f2) - PACKPATH=$(echo $DIFF | egrep -o "package-system/[^ ]*") - DOCKER=$(test -e $PACKPATH/Dockerfile* && echo 1 || echo 0) # Assume the build scripts will use the Dockerfile if found in the package path + PACKPATH=$(echo $DIFF | egrep -o "package-system/[^/ ]+(?=/| )" | head -n 1) + DOCKER=$(test -e ${PACKPATH%% }/Dockerfile* && echo 1 || echo 0) # Assume the build scripts will use the Dockerfile if found in the package path JSONline="{\"package\": \"$PACKAGE\", \"os\": \"$OS_RUNNER\", \"dockerfile\": \"$DOCKER\"}," if [[ "$JSON" != *"$JSONline"* ]]; then JSON="$JSON$JSONline"