From ff081551709c79ee5c9bdcea623b3bc4aeff1c0b Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Wed, 10 Jun 2026 09:45:06 -0700 Subject: [PATCH] Debug sync-and-simulate cron job: surface curl output and log auth failures Remove -s (silent) from curl so CI logs show the HTTP response on failure. Add logger.error in requireCronSecret so 401s from bad/missing secrets appear in Sentry. Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/sync-and-simulate.yml | 2 +- app/lib/cron-auth.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/sync-and-simulate.yml b/.forgejo/workflows/sync-and-simulate.yml index bd2f614..ac669e6 100644 --- a/.forgejo/workflows/sync-and-simulate.yml +++ b/.forgejo/workflows/sync-and-simulate.yml @@ -9,6 +9,6 @@ jobs: steps: - name: Sync standings and run simulations where changed run: | - curl -sf -X POST https://brackt.com/admin/jobs/sync-and-simulate \ + curl -f -X POST https://brackt.com/admin/jobs/sync-and-simulate \ -H "X-Cron-Secret: ${{ secrets.CRON_SECRET }}" \ -H "Content-Type: application/json" diff --git a/app/lib/cron-auth.ts b/app/lib/cron-auth.ts index 93ce142..7e33d40 100644 --- a/app/lib/cron-auth.ts +++ b/app/lib/cron-auth.ts @@ -1,7 +1,10 @@ +import { logger } from "~/lib/logger"; + export function requireCronSecret(request: Request): void { const secret = process.env.CRON_SECRET; if (!secret) throw new Response("CRON_SECRET not configured", { status: 500 }); if (request.headers.get("x-cron-secret") !== secret) { + logger.error("[cron-auth] Invalid or missing X-Cron-Secret header"); throw new Response("Unauthorized", { status: 401 }); } }