Skip to content

Harden CI against scheduled-workflow inactivity disable#685

Open
rly wants to merge 2 commits into
devfrom
ci/harden-against-inactivity-disable
Open

Harden CI against scheduled-workflow inactivity disable#685
rly wants to merge 2 commits into
devfrom
ci/harden-against-inactivity-disable

Conversation

@rly
Copy link
Copy Markdown
Contributor

@rly rly commented May 7, 2026

Closes #684.

Summary

  • Split the linkcheck workflow so PR gating cannot be killed by inactivity. check_sphinx_links.yml now triggers on pull_request: + workflow_call: (no schedule:, so it cannot be auto-disabled). The daily cron lives in a new thin caller check_sphinx_links_scheduled.yml that reuses the PR workflow via uses: (no duplicated steps). If the scheduled file is ever auto-disabled, PR gating is unaffected.
  • Add audit_disabled_workflows.yml. Runs on push to dev, on pull_request_target (chosen over pull_request so the audit also works on fork PRs, where pull_request would have a read-only token), and on workflow_dispatch. Calls the workflows API, filters for state == 'disabled_inactivity', and opens a deduped issue. The audit has no schedule: trigger, so it cannot be auto-disabled itself.

pull_request_target is normally a security footgun when a workflow checks out and executes PR code; this audit does neither (only API calls), so the elevated token is safe here.

Test plan

  • CI passes on this PR (the new Audit disabled workflows job runs and is green; linkcheck PR job runs and is green).
  • After merge, manually disable a low-impact workflow once and push a no-op commit to dev; confirm the audit creates an issue with the expected title and skips on a subsequent push (dedup works).
  • Confirm the scheduled caller fires at 05:00 UTC the next day and reuses the linkcheck job.

🤖 Generated with Claude Code

rly and others added 2 commits May 7, 2026 11:47
Two related changes:

1. Decouple the linkcheck schedule from PR gating. GitHub auto-disables
   workflows that have a `schedule:` trigger after 60 days of repo
   inactivity, and once disabled the workflow ignores all triggers
   including `pull_request:`. That is how PR gating silently disappeared
   for ~5 months prior to PR #683.

   - `check_sphinx_links.yml` now triggers on `pull_request:` and
     `workflow_call:`. Without `schedule:` it is not subject to inactivity
     disable.
   - `check_sphinx_links_scheduled.yml` is a thin caller that fires the
     daily cron and reuses the PR workflow via `uses:`. If this file is
     ever auto-disabled, PR gating is unaffected.

2. Add `audit_disabled_workflows.yml`. Runs on push to `dev`, on
   `pull_request_target` (so it works for fork PRs with a writable
   token), and on manual dispatch. Lists workflows in
   `disabled_inactivity` state via the API and opens an issue, deduped
   by title against existing open issues. The audit itself has no
   `schedule:` trigger, so it cannot be auto-disabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rly rly requested a review from oruebel May 7, 2026 19:19
@rly rly enabled auto-merge (squash) May 7, 2026 19:19
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.

Harden CI against scheduled-workflow inactivity disable

1 participant