Skip to content

Cleanup Unverified Users #6225

Cleanup Unverified Users

Cleanup Unverified Users #6225

name: Cleanup Unverified Users
on:
schedule:
# Run every hour
- cron: '0 * * * *'
workflow_dispatch: # Allow manual triggering
jobs:
cleanup:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run cleanup script
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
echo "Calling cleanup API endpoint..."
curl -X POST "${{ vars.APP_URL }}/api/auth/cleanup-unverified" \
-H "Content-Type: application/json" \
-w "\nHTTP Status: %{http_code}\n" \
-s
- name: Report cleanup results
if: always()
run: |
echo "Cleanup workflow completed at $(date)"
echo "Check the logs above for details"