Skip to content

Commit

Permalink
create_destory_test_vm minor improvement
Browse files Browse the repository at this point in the history
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 <rolisaemeka-ctr@wikimedia.org>
  • Loading branch information
Ndibe Raymond Olisaemeka committed Dec 30, 2023
1 parent 0201313 commit c063811
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/create_destroy_test_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c063811

Please sign in to comment.