Skip to content

preview-env-clean

preview-env-clean #634

---
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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