Skip to content

Clean Validation Environments #9331

Clean Validation Environments

Clean Validation Environments #9331

---
name: Clean Validation Environments
on: # yamllint disable-line rule:truthy
schedule:
# Every 2 hours
- cron: "0 */2 * * *"
workflow_dispatch:
jobs:
clean:
name: Clean
runs-on: ubuntu-latest
environment: CICD
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
# This is CRITICAL since we're making decisions based on branch existence
fetch-depth: 0
persist-credentials: false
- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ (secrets.AZURE_ENVIRONMENT != '' && secrets.AZURE_ENVIRONMENT) || 'AzureCloud' }}
- name: Run clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAIN_TRE_ID: ${{ secrets.TRE_ID }}
GITHUB_REPOSITORY: ${{ github.repository}}
BRANCH_LAST_ACTIVITY_IN_HOURS_FOR_STOP: 2
BRANCH_LAST_ACTIVITY_IN_HOURS_FOR_DESTROY: 48
run: devops/scripts/clean_ci_validation_envs.sh