From 10ddff77f1bed372a8aa1951eb9867e923f78f6a Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Fri, 20 Jun 2025 08:53:50 +0100 Subject: [PATCH 1/2] [NRL-1473] Build artifacts before TF destroy of PR envs --- .github/workflows/pr-env-destroy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-destroy.yml b/.github/workflows/pr-env-destroy.yml index 42e5bab46..5528d05fc 100644 --- a/.github/workflows/pr-env-destroy.yml +++ b/.github/workflows/pr-env-destroy.yml @@ -4,6 +4,7 @@ run-name: "Destroy PR Environment - #${{ github.event.pull_request.number }} (${ on: pull_request: types: [closed] + workflow_dispatch: concurrency: group: environment-${{ github.event.pull_request.number }} @@ -73,9 +74,11 @@ jobs: - name: Terraform Init run: | terraform -chdir=terraform/infrastructure init - terraform -chdir=terraform/infrastructure workspace new ${{ needs.set-environment-id.outputs.environment_id }} || \ terraform -chdir=terraform/infrastructure workspace select ${{ needs.set-environment-id.outputs.environment_id }} + - name: Build artifacts + run: cd terraform/infrastructure && make build-artifacts + - name: Terraform Destroy run: | terraform -chdir=terraform/infrastructure destroy \ From 8ed721ff25b71dd9ace51186cc87690b0440f89d Mon Sep 17 00:00:00 2001 From: Matt Dean Date: Tue, 1 Jul 2025 06:36:09 +0100 Subject: [PATCH 2/2] [NRL-1473] Add get-s3-perms to destroy workflow --- .github/workflows/pr-env-destroy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-env-destroy.yml b/.github/workflows/pr-env-destroy.yml index 5528d05fc..83a005079 100644 --- a/.github/workflows/pr-env-destroy.yml +++ b/.github/workflows/pr-env-destroy.yml @@ -77,7 +77,9 @@ jobs: terraform -chdir=terraform/infrastructure workspace select ${{ needs.set-environment-id.outputs.environment_id }} - name: Build artifacts - run: cd terraform/infrastructure && make build-artifacts + run: | + make build + make get-s3-permissions - name: Terraform Destroy run: |