Skip to content

preview-env-clean

preview-env-clean #6

---
name: preview-env-clean
on:
schedule:
- cron: 0 6,22 * * *
workflow_call:
inputs:
pull-request:
description: |
Limit cleanup to a single pull request (number) and a minimal mode.
Useful for quickly eliminating inconsistencies while waiting for the full cleanup cycle to run.
required: false
type: number
secrets:
VAULT_ADDR:
required: true
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
workflow_dispatch:
jobs:
preview-env-clean:
concurrency:
group: ${{ github.workflow }}-${{ inputs.pull-request }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate a GitHub token
id: github-token
uses: camunda/infra-global-github-actions/generate-github-app-token-from-vault-secrets@main
with:
github-app-id-vault-key: GITHUB_PREVIEW_ENVIRONMENTS_APP_ID
github-app-id-vault-path: secret/data/products/connectors/ci/common
github-app-private-key-vault-key: GITHUB_PREVIEW_ENVIRONMENTS_APP_PRIVATE_KEY
github-app-private-key-vault-path: secret/data/products/connectors/ci/common
vault-auth-method: approle
vault-auth-role-id: ${{ secrets.VAULT_ROLE_ID }}
vault-auth-secret-id: ${{ secrets.VAULT_SECRET_ID}}
vault-url: ${{ secrets.VAULT_ADDR }}
- uses: camunda/infra-global-github-actions/preview-env/clean@main
with:
labels: deploy-preview
pull-request: ${{ inputs.pull-request }}
token: ${{ steps.github-token.outputs.token }}
ttl: 21d
warning-ttl: 14d