Skip to content

Cleanup Old Memories #65

Cleanup Old Memories

Cleanup Old Memories #65

name: Cleanup Old Memories
on:
schedule:
# Runs at 00:00 UTC every day
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual triggering
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Run cleanup API
run: |
set -e
response=$(curl -s -o /tmp/response.json -w "%{http_code}" \
-X POST "$API_URL/batch/cleanup-old-memories" \
-H "Content-Type: application/json" \
-H "x-batch-secret: $BATCH_JOB_SECRET")
if [ "$response" -ne 200 ]; then
echo "Cleanup failed with status $response"
cat /tmp/response.json
exit 1
fi
echo "Cleanup successful"
cat /tmp/response.json
env:
API_URL: ${{ secrets.API_URL }}
BATCH_JOB_SECRET: ${{ secrets.BATCH_JOB_SECRET }}