From 5b2bfda2a784635418268a5944415d6599af212c Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Fri, 5 Jan 2024 20:58:50 +0100 Subject: [PATCH] Prepare cleanup --- .github/workflows/terraform.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yaml b/.github/workflows/terraform.yaml index ccee002..beaf288 100644 --- a/.github/workflows/terraform.yaml +++ b/.github/workflows/terraform.yaml @@ -34,9 +34,13 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.B2_TFBACKUP_SECRET_KEY }} AWS_DEFAULT_REGION: us-east-1 AWS_ENDPOINT_URL: https://s3.us-east-005.backblazeb2.com + S3_URI: s3://terraform-state-backup/${{ github.repository }} run: | terraform show -json > state.json - aws s3 cp state.json s3://terraform-state-backup/${{ github.repository }}/$(date +%s).json + aws s3 cp state.json ${S3_URI}/$(date +%s).json + + FILES=$(aws s3 ls ${S3_URI}/ | sort -) + echo ${FILES} - run: terraform show -no-color tfplan > summary.txt if: ${{ github.event_name == 'pull_request' }}