From 28ab311b51c7f677717a4c0495019509031b6348 Mon Sep 17 00:00:00 2001 From: Glass Date: Tue, 16 Jan 2024 15:32:33 -0700 Subject: [PATCH] Skip delete SSH keys when none are present (#540) Resolves issue with deleting GCP ssh keys if none are there Co-authored-by: Corey Cox <69321580+amc-corey-cox@users.noreply.github.com> --- .github/workflows/build-and-deploy-images.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-deploy-images.yaml b/.github/workflows/build-and-deploy-images.yaml index ae46c85c1..e6f73721b 100644 --- a/.github/workflows/build-and-deploy-images.yaml +++ b/.github/workflows/build-and-deploy-images.yaml @@ -114,11 +114,13 @@ jobs: - name: "Remove old SSH keys" run: | - for i in $(gcloud compute os-login ssh-keys list | grep -v FINGERPRINT) - do - echo $i - gcloud compute os-login ssh-keys remove --key $i - done + if [[ $(gcloud compute os-login ssh-keys list | grep -v FINGERPRINT) ]]; then + for i in $(gcloud compute os-login ssh-keys list | grep -v FINGERPRINT) + do + echo $i + gcloud compute os-login ssh-keys remove --key $i + done + fi - name: "Update API Service" run: |