Cleanup Old Memories #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |