ci(nightly): run on a cron, not on every push to main#4
Merged
Conversation
The workflow was a nightly in name only: `push: branches: [main]` built on
every merge, publishing 9 permanent releases in one day for one day's work.
A day's merges should land in one build.
Switch to `schedule: 37 6 * * *` (02:37 EDT / 01:37 EST; the offset minute
avoids GitHub's on-the-hour cron backlog) and gate scheduled runs on a
`check_changes` job, so a quiet day or a docs-only day skips entirely.
`paths-ignore` had to go regardless — path filters only apply to
push/pull_request, so it would have become dead config under `schedule`. The
replacement diffs the whole day rather than one push at a time.
workflow_dispatch keeps working and now bypasses the gate, so a manual run is
always a build — no `force` input needed.
Borrowed from upstream's release.yml, which has run a real nightly for far
longer:
- `!failure() && !cancelled()` on the build job, which is what lets a
*skipped* gate through while still halting on a broken one; `always()`
would build even when the gate errored.
- Date the version from `github.run_started_at`, not wall-clock `date -u`:
a build starting at 23:59 UTC would otherwise stamp tomorrow.
- `contents: read` by default, `write` only on the job that publishes.
Also stop cancelling in-progress runs. The publish step deletes the `nightly`
release before recreating it; a cancel in that window leaves nodes with no
release to pull, and since their ExecStartPre is best-effort they would
silently keep running a stale build. Upstream has no concurrency group either.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ua6eR6J5wHne2wfEd3VF9N
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.
The nightly was a nightly in name only:
push: branches: [main]built on every merge — 9 permanent releases today for one day of work. A day of merges should land in one build.What changed
schedule: "37 6 * * *"(02:37 EDT / 01:37 EST),pushtrigger removed. The offset minute is deliberate — crons on the hour queue behind GitHub's peak load and get delayed or dropped.check_changesgate job. A scheduled run builds only ifmaingained a non-docs commit since the last nightly, resolved from the rolling release'stargetCommitish. Quiet day or docs-only day → no build, no version burned. Costs ~10s (no checkout; uses the compare API).workflow_dispatchbypasses the gate and always builds, so "get my merge onto a node now" needs noforceinput. The runbook row for it is unchanged.paths-ignoreremoved — it had to go regardless: path filters only apply topush/pull_request, so underscheduleit would have been dead config that silently stopped working. The gate replaces it and is strictly better: it diffs the whole day rather than judging each push alone.cancel-in-progress. Publish deletes thenightlyrelease before recreating it; a cancel in that window leaves nodes with no release to pull, and sinceExecStartPreis best-effort they would silently keep running a stale build. Run ci(nightly): run on a cron, not on every push to main #4 today was cancelled, so this fires in practice.Borrowed from upstream
release.ymlUpstream has run a real scheduled nightly far longer than we have, and had three things we did not:
!failure() && !cancelled()on the build job — this is what lets a skipped gate through while still halting on a broken one.always()would build even when the gate errored. Without this the build job silently never runs.github.run_started_at, not wall-clockdate -u: a build starting at 23:59 UTC would otherwise stamp tomorrow.contents: readby default,writeonly on the job that publishes.Deliberate divergences: their gate is SHA-equality only (would build on a docs commit) — ours is docs-aware, preserving the
paths-ignoreintent. Theirnightlychannel is an npm dist-tag, so they have no rolling-release delete/recreate to protect; ours is fork-local and needs the concurrency fix. Their cron is every 3h — a reminder thatnightlyupstream means a channel, not a cadence.Verification
db3a315d4) → skip; code commit (d106a284d) → build; unreachable SHA → build (fails safe).check_changes→ skipped,build→ in_progress, confirming theif:expression on a skipped gate. Cancelled before publish, so no release was created.pushtrigger. First build under the new regime is tonight's cron, or a dispatch.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ua6eR6J5wHne2wfEd3VF9N
Note
Switch nightly workflow trigger from push to cron schedule
workflow_dispatchfor manual runs.check_changesjob that compares HEAD against the last nightly release and skips the build if only docs changed since the last nightly; manual dispatches always build.contents: writepermission from global scope into thebuildjob only, and setscancel-in-progress: falseso in-progress runs are never cancelled.github.run_started_atinstead of the step execution time to avoid day-boundary mismatches.📊 Macroscope summarized 01f5a95. 2 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.