From 0754a9360319c43ce502664afd1af415cf58cdb5 Mon Sep 17 00:00:00 2001 From: Jeremy Moore Date: Fri, 28 Jun 2024 16:45:33 -0400 Subject: [PATCH] trigger destroy workflow via 'destroy' label --- .github/workflows/dev_destroy.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev_destroy.yml b/.github/workflows/dev_destroy.yml index 50ae96859..5f7b959c6 100644 --- a/.github/workflows/dev_destroy.yml +++ b/.github/workflows/dev_destroy.yml @@ -1,9 +1,9 @@ --- -name: Create Dev Deployment +name: Destroy Dev Deployment on: pull_request: - types: [unlabeled] + types: [labeled] env: TERRAFORM_CLOUD_TOKENS: app.terraform.io=${{ secrets.TERRAFORM_API_TOKEN }} @@ -12,7 +12,7 @@ env: jobs: deploy: - if: ${{ github.event.label.name == 'dev-deploy' }} + if: ${{ github.event.label.name == 'destroy' }} runs-on: ubuntu-latest steps: - name: checkout terraform @@ -28,3 +28,11 @@ jobs: path: terraform/dev workspace: dev-${{ github.head_ref }} + - name: remove labels + uses: actions-ecosystem/action-remove-labels@v1.3.0 + with: + github_token: ${{ github.token }} + labels: | + deploy + destroy +