Repository navigation
feat(monitoring): alert when GitHub stops running a scheduled workflow - #1847
Merged
Merged
Conversation
cve-scan, digests, the weekly audit, wiki-watch and Scorecard run only on GitHub's schedule, and GitHub disables a public repository's schedules after 60 days of inactivity without telling anyone. A daily workflow-state job asks the public API for each workflow's state and newest finished scheduled run, and carries the expiry of the audit's one-year Claude OAuth token. ScheduledWorkflowStale, ScheduledWorkflowDisabled and AuditTokenExpiringSoon read it, with promtool tests for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A new daily job,
workflow-state(scripts/collect-workflow-state.py, run onprometheusviarun-scheduled.sh), asks GitHub's public API, anonymously, for each scheduled workflow's state and newest finished scheduled run, and writesgithub-workflows.prom. Three new warnings inbackup.rules.yamlread it:ScheduledWorkflowStale: no finished scheduled run in nine days.ScheduledWorkflowDisabled: GitHub's 60-day inactivity disable, or a manual one.AuditTokenExpiringSoon: 30 days before the weekly audit's one-yearCLAUDE_CODE_OAUTH_TOKENlapses.New units
systemd/homelab-workflow-state.{service,timer}, aJOBSrow,make workflow-state, promtool tests, and a runbook section with the token-rotation steps. 190 Prometheus rules, 218 in all.Why
cve-scan, digests, the weekly audit, wiki-watch and Scorecard run only on GitHub's schedule, and a stopped schedule sends nothing. The clock is the last finished run, not the last success: the first live read found
digestshad failed on each of the four Mondays since 2026-11-02, which it does on purpose when it finds drift. A last-success clock would fire on it for good.The token's issue date is set to 2026-11-26, the day the audit was added (#1773). Confirm it against
gh secret list.Blast radius
prometheusgets one more daily timer making about ten anonymous HTTPS calls to api.github.com. Three new warnings, none paging. If the collector breaks,ScheduledJobStalecovers it.secrets/*.sops.yamlVerification
scripts/collect-workflow-state.py --self-test: 15 PASS. This includes "every scheduled workflow in .github/workflows is declared".--stdoutagainst the live API printed all four existing workflows active.scorecard.ymlis skipped until that PR merges.promtool v3.16.0, the pinned version, checksum-verified:
check rules backup.rules.yamlgave 10 rules;test rules workflow-state.test.yaml backup.test.yamlgave SUCCESS.check_docs.pyOK.lint.shpassed, with docker-backed linters skipped.self-tests.shcan't run cleanly on this Windows host (no python3 or openssl); CI runs it.make validatepasses (not run here; no docker)Deployed to the lab and confirmed working (after merge:
make install-timerson prometheus, thensystemctl list-timers 'homelab-workflow-state*')Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code