Skip to content

Webhook Log Retention #3

Webhook Log Retention

Webhook Log Retention #3

name: Webhook Log Retention
on:
schedule:
- cron: "15 2 * * *"
workflow_dispatch:
jobs:
purge-webhook-logs:
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: backend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Purge old webhook logs
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
LOG_RETENTION_DAYS: ${{ vars.LOG_RETENTION_DAYS || '30' }}
LOG_PURGE_BATCH_SIZE: ${{ vars.LOG_PURGE_BATCH_SIZE || '1000' }}
LOG_PURGE_MAX_DURATION_MS: "300000"
run: npm run purge:webhook-logs