From 6c51cda6fb3fcac3de7db3b5125a51149a49abee Mon Sep 17 00:00:00 2001 From: Nicolas Rey Date: Fri, 18 Oct 2024 10:34:38 -0300 Subject: [PATCH] ci: use the build args from the dotenv file --- .github/workflows/test-tools.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-tools.yml b/.github/workflows/test-tools.yml index b145bd1..a097e28 100644 --- a/.github/workflows/test-tools.yml +++ b/.github/workflows/test-tools.yml @@ -35,8 +35,12 @@ jobs: - name: Load .env file and set build-args id: load-env run: | - build_args=$(awk -F= '{print "--build-arg", $1"="$2}' .env | tr '\n' ' ') - echo "build_args=$build_args" >> $GITHUB_ENV + build_args="" + while read -r line; do + key=$(echo "$line" | cut -d '=' -f 1) + value=$(echo "$line" | cut -d '=' -f 2) + echo "$key=$value" >> build-args.txt + done < .env - name: Build container uses: docker/build-push-action@v6 @@ -46,7 +50,8 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max tags: theredguild/container-sec-tools:latest - build-args: ${{ env.build_args }} + build-args: | + $(cat build-args.txt) - name: Check disk space run: df -h