Skip to content
database

GitHub Action

Astra DB Environment Cleanup

v1.0.2 Latest version

Astra DB Environment Cleanup

database

Astra DB Environment Cleanup

Delete unused databases in Datastax Astra DB

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Astra DB Environment Cleanup

uses: nicoloboschi/cleanup-astradb-env@v1.0.2

Learn more about this action in nicoloboschi/cleanup-astradb-env

Choose a version

@nicoloboschi/cleanup-astradb-env Github action

This action deletes DataStax AstraDB databases that have not been used for some time.

Related actions:

  • @nicoloboschi/setup-astradb action: Creates a AstraDB database.
  • @nicoloboschi/cleanup-astradb action: Deletes a specific AstraDB database.

Action Inputs

Input name Description Required Default Value
token Astra DB application token. It needs to have enough permissions to create/delete databases in the organization. true
threshold-seconds Threshold in seconds to delete databases based on their last usage time. false 3600 (1 hour)
wait Whether to wait for the database to be deleted or not. false true
env Astra DB environment. (ENV, PROD). false PROD

Example

name: Clean Astra env

on:
  workflow_dispatch: { }
  schedule:
    - cron: "*/5 * * * *"

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - name: Clean AstraDB databases that have not been used in the last hour
        uses: nicoloboschi/cleanup-astradb-env@v1
        with:
          token: ${{ secrets.ASTRA_DB_TOKEN }}