corso/.github/workflows/ci_test_cleanup.yml
Keepers 9357d6b6ac
swap over the remaining go setup scripts (#957)
## Type of change

- [x] 💻 CI/Deployment

## Issue(s)

* #790

## Test Plan

- [x] 💚 E2E
2022-09-27 17:12:14 +00:00

44 lines
1.3 KiB
YAML

name: CI Test Cleanup
on:
schedule:
# every half hour
- cron: "*/30 * * * *"
jobs:
Test-User-Data-Cleanup:
environment: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v3
with:
go-version-file: src/go.mod
# sets the maximimum time to now-30m.
# CI test have a 10 minute timeout.
# At 20 minutes ago, we should be safe from conflicts.
# The additional 10 minutes is just to be good citizens.
- name: Set purge boundary
run: |
echo "HALF_HOUR_AGO=$(date -d '30 minutes ago' -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
# run the folder purge
- name: Purge folders
working-directory: ./src
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
CORSO_M356_TEST_USER_ID: ${{ secrets.CORSO_M356_TEST_USER_ID }}
DELETE_FOLDER_PREFIX: "Corso_Restore_"
TENANT_ID: ${{ secrets.TENANT_ID }}
run: >
go run ./cmd/purge/purge.go
--user ${{ secrets.CORSO_M356_TEST_USER_ID }}
--prefix ${{ env.DELETE_FOLDER_PREFIX }}
--before ${{ env.HALF_HOUR_AGO }}