Repository navigation
Run CI nightly on main, and start it by hand - #126
Merged
Merged
Conversation
ci.yml gets a schedule trigger, cron "27 5 * * *" (05:27 UTC, an odd minute because GitHub delays scheduled runs at the start of every hour), and workflow_dispatch. push and pull_request stay as they are. The actionlint job now passes reviewdog's reporter by event: the action's default github-pr-check on a pull request, github-annotations on every other event. A schedule event's payload has no repository, so the check reporter in reviewdog 0.21.2 posts to repos///check-runs, gets a 404 and exits 1 (its log-annotation fallback covers a 403 only), which would make every nightly run red. github-annotations writes the same annotations without the API call; a push already produced that output through the 403 fallback, since this token has no checks: write. Harness-Task: 40 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.
CI on
mainnow also runs every night, and can be started by hand.Harness-Task: 40
What changes
.github/workflows/ci.ymlgets two more triggers.pushandpull_requeststay as they are:A scheduled run tests the latest commit on the default branch. So if
maingoes red with no push behind it (a dependency, a runner image, an expired date), we find out the next morning.The one guard: the actionlint job's reporter
actionlintrunsreviewdog/action-actionlint@v1(image v1.80.4, reviewdog 0.21.2) with its default reporter,github-pr-check. That reporter would fail every scheduled run:repository. Aschedulepayload has none, so it creates its check run atrepos///check-runsand gets a 404.service/github/check.go,Flush) covers only a 403, so it returnsfailed to create check: ... 404 Not Foundand exits 1. The action'sentrypoint.shruns underset -euwith reviewdog last in the pipeline, so the step fails even withfail_level: none. This is Github-Check gives POST 404 error when used inside a cron job reviewdog/reviewdog#832 and #1263, both still open.The step now passes
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-check' || 'github-annotations' }}:github-pr-checkwithfilter_mode: file, so a PR run checks exactly what it did before.github-annotationswrites the annotations straight to the log, with no API call. A push already produced that same output: this workflow's token has nochecks: write, so the check reporter got a 403 and fell back to the same writer. Commit8fc7faf's check runs show this. There is oneactionlintrun (the job) and no separate check run from reviewdog.workflow_dispatchgets the same reporter asschedule, so the dispatched run below goes down the nightly path.Local reproduction with the reviewdog 0.21.2 release binary (checksum verified) and the flags the action passes. The GitHub API was a stub on localhost (
GITHUB_API): it answers 404 to an empty owner or repository and 403 to a check-run create, like a token withoutchecks: write:schedulegithub-pr-checkPOST /repos///check-runs-> 404failed to create check)pushgithub-pr-checkPOST /repos/cosyte/config/check-runs-> 403, fallbackworkflow_dispatchgithub-pr-checkPOST /repos/cosyte/config/check-runs-> 403, fallbackschedulegithub-annotationsworkflow_dispatchgithub-annotationspushgithub-annotationsThe annotation line was the same in every 0-exit case.
Why no other step needed a guard
We read every job and step. None reads
github.event.pull_request.*,github.head_ref,github.base_ref,github.event.beforeorgithub.event_name, and none diffs against a PR base. The scriptsverifyruns (changeset-guard,release-notes prepare,credential-surface,install-hardening,readme-check,drift-check,check-no-emdash) read no event variables.release-notes preparecompares HEAD with HEAD^, which on a scheduled run is the tip ofmainand its parent, the same shape a push tomainhas.release.ymltriggers only onpush, so a nightly CI run cannot start a release.No job was renamed or dropped, so the required checks (
actionlint,verify (22),verify (24)) are unchanged.Proof of the non-PR path
gh workflow run ci.yml -R cosyte/config --ref harness/40-nightly-run-of-ciwas accepted and ran on the head commit5c5bca2: https://github.com/cosyte/config/actions/runs/39356352654. It concludedsuccess, withverify (22),verify (24),release-dry-runandactionlintall passing on the first attempt.In that run the actionlint step shows
reporter: github-annotationsin its inputs and prints##[error][actionlint] reported by reviewdog. That is the existing node20 finding inperf-calibration.yml, whichfail_level: nonereports without failing. So on the nightly path the job lints every workflow file and does not skip.Gate run locally
All passed, in
verify's order, with pnpm 10.34.5:changeset-guard,release-notes prepare,credential-surface,install-hardening,readme-check,drift-check,pnpm install --frozen-lockfile,check:no-emdash,format:check,typecheck,lint,test,build,attw. Also actionlint 1.7.7 over.github/workflows/*.yml. We randrift-checkfrom a copy laid out as CI lays it out (<dir>/config), because it grades theconfigcheckout beside the umbrella root. In this worktree's path it finds none and exits 2 by design.Notes
concurrencygroup is${{ github.workflow }}-${{ github.ref }}withcancel-in-progress: true. A scheduled run and a push run onmainshare one group, so whichever starts second cancels the other. Both test the samemain, and a cancelled run reports no result either way. We left it alone because it is outside this change's scope.Flushonce it has written more than 9 annotations (MaxLoggingAnnotationsPerStep,service/github/githubutils/comment_writer.go), whateverfail_levelsays. A push already reached that writer through the 403 fallback, so this change does not add the limit. It means amainwith 10 or more actionlint findings goes red on the nightly, as it would on a push. Today there is one finding.src/or in a published tarball moves.🤖 Generated with Claude Code