Skip to content

Document Directus 12.2.0 #75

Document Directus 12.2.0

Document Directus 12.2.0 #75

name: Search Index Cleanup
on:
pull_request:
branches:
- main
types:
- closed
workflow_dispatch:
inputs:
branch:
description: Branch name for the preview index to delete
required: true
type: string
permissions:
contents: read
jobs:
cleanup-preview-index:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
concurrency:
group: search-index-preview-${{ github.event.pull_request.number || inputs.branch }}
cancel-in-progress: true
env:
TYPESENSE_URL: ${{ secrets.TYPESENSE_URL }}
TYPESENSE_PRIVATE_API_KEY: ${{ secrets.TYPESENSE_PRIVATE_API_KEY }}
TYPESENSE_PREVIEW_BRANCH: ${{ github.event.pull_request.head.ref || inputs.branch }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
# This job runs one repository script only; skip package postinstall/build scripts.
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Delete preview collection
run: pnpm typesense:cleanup-preview --branch "$TYPESENSE_PREVIEW_BRANCH"