From b4efd6345448975b1871645b83546ab6bf2284d8 Mon Sep 17 00:00:00 2001 From: Anton Belodedenko <2033996+ab77@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:45:45 -0700 Subject: [PATCH] Cleanup AWS/EC2 key pairs change-type: patch --- .github/workflows/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b40e4c5..bb8b2f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -998,6 +998,16 @@ jobs: with_backoff balena keys | grep ${{ steps.provision-ssh-key.outputs.key_id }} \ | awk '{print $1}' | xargs --no-run-if-empty balena key rm --yes + - name: remove AWS/EC2 key-pair + if: always() && matrix.target == 'compose-private-pki' + continue-on-error: true + run: | + set -ue + + [[ '${{ vars.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x + + aws ec2 delete-key-pair --key-name ${{ steps.generate-key-pair.outputs.key_name }} + - name: delete balenaOS test device if: always() && matrix.target == 'balena-public-pki' continue-on-error: true