Switch error logging from console.error to the injected logger.error
pattern for consistency with the rest of the scraper service layer.
Update tests to verify logger.error is called instead of console.error.
Move all GitHub Actions expressions into env: block instead of
interpolating directly into shell script. Test output containing
single quotes was breaking the shell parser, causing EOF errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add recordScraperRun(db, runData) to scraperService that persists
scraper execution history to the scraper_runs collection. The function
inserts a document containing all run metadata (jobId, trigger, status,
duration, unit metrics, timing, errors) along with a recordedAt
timestamp.
Designed for use in finally blocks: errors during recording are caught,
logged, and swallowed so they never interrupt the scraper pipeline.
Returns the insertOne result on success or null on failure.
Includes 17 tests covering insertion behavior, field preservation,
graceful error handling, return values, and recordedAt semantics.