fix: github action that reports stripe usage (#1599)

This commit is contained in:
Shubham Palriwala
2023-11-09 15:42:23 +05:30
committed by GitHub
parent a34606ab03
commit 7acd2ccabb
2 changed files with 5 additions and 5 deletions

View File

@@ -10,13 +10,13 @@ jobs:
cron-reportUsageToStripe:
env:
APP_URL: ${{ secrets.APP_URL }}
API_KEY: ${{ secrets.API_KEY }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
runs-on: ubuntu-latest
steps:
- name: cURL request
if: ${{ env.APP_URL && env.API_KEY }}
if: ${{ env.APP_URL && env.CRON_SECRET }}
run: |
curl ${{ env.APP_URL }}/api/cron/report-usage \
-X GET \
-H 'x-api-key: ${{ env.API_KEY }}' \
-X POST \
-H 'x-api-key: ${{ env.CRON_SECRET }}' \
--fail

View File

@@ -51,7 +51,7 @@ async function reportTeamUsage(team: TTeam) {
}
}
export async function GET(): Promise<NextResponse> {
export async function POST(): Promise<NextResponse> {
const headersList = headers();
const apiKey = headersList.get("x-api-key");