Skip to content

fix(ci): harden sponsor-monitor cron workflow against silent DNS failures - #86

Open
Sam-Aitech wants to merge 1 commit into
mainfrom
fix/sponsor-monitor-cron-hardening
Open

fix(ci): harden sponsor-monitor cron workflow against silent DNS failures#86
Sam-Aitech wants to merge 1 commit into
mainfrom
fix/sponsor-monitor-cron-hardening

Conversation

@Sam-Aitech

Copy link
Copy Markdown
Owner

Summary

  • Six consecutive daily runs (Jul 30–Aug 6) failed with curl exit code 6 (unresolved hostname) because the CRON_URL secret pointed at an unreachable host; bash -e made the Evaluate response step get skipped entirely, so the failure was silent in the job summary.
  • Root cause confirmed against live state: production (checkbyai.net) is healthy right now (/, /api/health → 200, /api/ops/cron-ping/health → 401 unauthenticated as expected), and the CRON_URL secret has been updated to https://checkbyai.net. This PR is the workflow-hardening half of the fix so a bad secret fails loud next time instead of six days quiet.
  • Adds a validation step (secrets present, CRON_URL is a bare https:// base URL with no path/query, DNS resolves) and a pre-flight authenticated health check before the trigger POST. Both curl calls now decode transport-error exit codes into readable messages. Workflow token permissions restricted to permissions: {}.

Test plan

  • YAML parses (js-yaml load)
  • URL validation shell logic unit-tested locally against https://checkbyai.net, trailing-slash, path, non-https, and query-string cases
  • Local pre-commit test suite passes (334 passed, 1 todo)
  • Manual workflow_dispatch run on this branch to confirm the hardened steps behave against real prod (202/409/423 all acceptable)

…ures

Six consecutive daily runs (Jul 30-Aug 6) failed with curl exit code 6
(unresolved hostname) because a stale CRON_URL secret pointed at an
unreachable host, and Evaluate response was skipped since curl's
nonzero exit under `bash -e` short-circuited the job before the HTTP
status was ever checked. The failure was silent and undiagnosable from
the job logs alone.

Adds explicit validation before the trigger POST: secrets present,
CRON_URL is a bare https:// base URL (no path/query), DNS resolves,
and the authenticated read-only health endpoint returns 200. Decodes
curl transport-error exit codes into readable messages and restricts
the workflow token to permissions: {}.
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant