From cd10a578a97842fc58f04e3cb6546a0e08ff3d62 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 19 Oct 2023 10:54:15 -0700 Subject: [PATCH 1/4] Use GHA expression to check if JSON string empty --- .github/actions/build-test-scan-push/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index d0ff8544..5764543b 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -84,7 +84,7 @@ runs: - name: Authenticate GCAR shell: bash run: | - if [ ! -z "${{ inputs.gcp-json }}" ]; then + if [[ '${{ inputs.gcp-json != "" }}' == "true" ]]; then gcloud auth configure-docker -q us-central1-docker.pkg.dev gcloud auth configure-docker -q us-docker.pkg.dev gcloud auth configure-docker -q asia-docker.pkg.dev From 90b26430ee5d5a10a127b0b76d4b4066984d323a Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 19 Oct 2023 10:58:07 -0700 Subject: [PATCH 2/4] Add `set -e` --- .github/actions/build-test-scan-push/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index 5764543b..7d5df020 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -84,6 +84,7 @@ runs: - name: Authenticate GCAR shell: bash run: | + set -e if [[ '${{ inputs.gcp-json != "" }}' == "true" ]]; then gcloud auth configure-docker -q us-central1-docker.pkg.dev gcloud auth configure-docker -q us-docker.pkg.dev From 9f20d4d5195907f3c141b470092a6d38dc67b180 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 19 Oct 2023 10:59:34 -0700 Subject: [PATCH 3/4] Add `set -e` and wrap logic --- .github/actions/build-test-scan-push/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index 7d5df020..b8fac49e 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -85,7 +85,7 @@ runs: shell: bash run: | set -e - if [[ '${{ inputs.gcp-json != "" }}' == "true" ]]; then + if [[ '${{ (inputs.gcp-json != "") }}' == "true" ]]; then gcloud auth configure-docker -q us-central1-docker.pkg.dev gcloud auth configure-docker -q us-docker.pkg.dev gcloud auth configure-docker -q asia-docker.pkg.dev From fa8f33991161ac5b5858b85041437dfdf4661cf7 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 19 Oct 2023 11:01:15 -0700 Subject: [PATCH 4/4] Swap quote style --- .github/actions/build-test-scan-push/action.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index b8fac49e..6e120ff2 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -84,8 +84,7 @@ runs: - name: Authenticate GCAR shell: bash run: | - set -e - if [[ '${{ (inputs.gcp-json != "") }}' == "true" ]]; then + if [[ "${{ inputs.gcp-json != '' }}" == "true" ]]; then gcloud auth configure-docker -q us-central1-docker.pkg.dev gcloud auth configure-docker -q us-docker.pkg.dev gcloud auth configure-docker -q asia-docker.pkg.dev