Clean Validation Environments #8688
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |