corso/.github/workflows/ci_test_cleanup.yml
Aarti Jivrajani 15ec0a65d6
Add alcion_restore_ folder prefix to cleanup script (#1998)
## Description

Add a prefix `Alcion_Restore_` to the cleanup CI action. 

## Does this PR need a docs update or release note?
- [X]  No 

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [X] 🐹 Trivial/Minor

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #1997 

## Test Plan

<!-- How will this be tested prior to merging.-->
- [X] 💪 Manual
2022-12-30 00:47:01 +00:00

37 lines
1.2 KiB
YAML

name: CI Test Cleanup
on:
schedule:
# every half hour
- cron: "*/30 * * * *"
jobs:
Test-User-Data-Cleanup:
environment: Testing
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
folder: [Corso_Restore_, TestRestore, testfolder, incrementals_ci_, Alcion_Restore_, '']
user: [CORSO_M365_TEST_USER_ID, CORSO_SECONDARY_M365_TEST_USER_ID, EXT_SDK_TEST_USER_ID]
steps:
- uses: actions/checkout@v3
# 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
- name: Purge CI-Produced Folders
uses: ./.github/actions/purge-m365-user-data
with:
user: ${{ secrets[matrix.user] }}
folder-prefix: ${{ matrix.folder }}
older-than: ${{ env.HALF_HOUR_AGO }}
azure-client-id: ${{ secrets.CLIENT_ID }}
azure-client-secret: ${{ secrets.CLIENT_SECRET }}
azure-tenant-id: ${{ secrets.TENANT_ID }}