From 82722278959c7cd1c1930e27c3457eca0a36f472 Mon Sep 17 00:00:00 2001 From: Keepers <104464746+ryanfkeepers@users.noreply.github.com> Date: Wed, 15 Jun 2022 12:46:28 -0600 Subject: [PATCH] add cron action to purge s3 test bucket weekly (#200) * add cron action to purge s3 test bucket weekly --- .github/workflows/weekly_cleanup.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/weekly_cleanup.yml diff --git a/.github/workflows/weekly_cleanup.yml b/.github/workflows/weekly_cleanup.yml new file mode 100644 index 000000000..f5bbec599 --- /dev/null +++ b/.github/workflows/weekly_cleanup.yml @@ -0,0 +1,25 @@ +name: Weekly S3 Test Bucket Cleanup +on: + schedule: + # every saturday at 23:59 (11:59pm) + - cron: "59 23 * * 6" + +permissions: + # required to retrieve AWS credentials + id-token: write + +jobs: + S3-Test-Cleanup: + runs-on: ubuntu-latest + + steps: + - name: Configure AWS credentials from Test account + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::951767375776:role/corso-testing-role + role-session-name: integration-testing + aws-region: us-east-1 + + - name: Delete all files in the test bucket + run: | + aws s3 rm s3://test-corso-repo-init --recursive \ No newline at end of file