Reset Free Tier Quotas #5
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: 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 |