From ad585bb006e030231ddd781665ded37791f2ae3d Mon Sep 17 00:00:00 2001 From: Ndibe Raymond Olisaemeka Date: Sat, 30 Dec 2023 02:18:16 +0000 Subject: [PATCH] create_destory_test_vm minor improvement (#1074) * create_destory_test_vm minor improvement use better checkmarks Signed-off-by: Ndibe Raymond Olisaemeka * create_destory_test_vm minor improvement improve the conditions of `destroy_test_vm` to only run when: * pr is closed and PR still has the `create-test-vm` label * `create-test-vm` label is removed from PR This ensures that the `destory_test_vm` only runs when neccessary and doesn't spam the github actions tab. issue: #1030 Signed-off-by: Ndibe Raymond Olisaemeka --------- Signed-off-by: Ndibe Raymond Olisaemeka Co-authored-by: Ndibe Raymond Olisaemeka --- .github/workflows/create_destroy_test_vm.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create_destroy_test_vm.yaml b/.github/workflows/create_destroy_test_vm.yaml index e8dbf757..61988453 100644 --- a/.github/workflows/create_destroy_test_vm.yaml +++ b/.github/workflows/create_destroy_test_vm.yaml @@ -286,12 +286,14 @@ jobs: ################################################################################## destroy_test_vm: if: | - github.event.action == 'closed' || - (github.event.action == 'unlabeled' && github.event.label.name == 'create-test-vm') || ( - github.event.action == 'reopened' || - github.event.action == 'synchronize' - ) && contains(github.event.pull_request.labels.*.name, 'create-test-vm') != true + github.event.action == 'closed' && + contains(github.event.pull_request.labels.*.name, 'create-test-vm') + ) || + ( + github.event.action == 'unlabeled' && + github.event.label.name == 'create-test-vm' + ) runs-on: ubuntu-latest steps: - name: Get pr number and droplet ip