Skip to content

Reset Free Tier Quotas #5

Reset Free Tier Quotas

Reset Free Tier Quotas #5

name: Reset Free Tier Quotas
on:
schedule:
# 1st of each month at 00:05 UTC
- cron: '5 0 1 * *'
workflow_dispatch: # Allow manual trigger for testing
jobs:
reset:
runs-on: ubuntu-latest
steps:
- name: Reset free-tier quotas
run: |
response=$(curl -s -w "\n%{http_code}" -X POST \
https://og-engine.com/admin/reset-free-quotas \
-H "Authorization: Bearer ${{ secrets.ADMIN_CRON_SECRET }}" \
-H "Content-Type: application/json")
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | head -n -1)
echo "Status: $http_code"
echo "Response: $body"
if [ "$http_code" != "200" ]; then
echo "::error::Reset failed with status $http_code"
exit 1
fi