From 332c9adefeffebde349571de6c98e4f4a710b06d Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Mon, 23 Nov 2026 08:52:56 -0500 Subject: [PATCH 1/2] Nightly: build when dev moved since the last nightly, not on a 24-hour window The check job looked for dev commits in the last 24 hours. GitHub starts the 06:00 UTC cron hours late (14:12 to 15:21 UTC over the last four runs), so when a run starts later in the day than the one before, commits made in that gap fall outside both windows and the nightly skips them. Today that happens if the run starts after 15:29 UTC: dev has nine merges since the published nightly (237e874) but the newest is c546dfc at 15:29 UTC yesterday. Compare dev's tip with the commit the nightly tag points at instead. A missing tag (a publish that failed after deleting the old release) builds. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz --- .github/workflows/nightly.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 04b1574..d08b7b9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -31,16 +31,22 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Check for new commits in last 24 hours + # Build when dev's tip differs from the commit the nightly tag points at. + # fetch-depth: 0 also fetches tags. A "commits in the last 24 hours" + # window skipped new commits whenever GitHub started the scheduled run + # later in the day than the run before (start times drift by hours). + # A missing tag (deleted by a publish that failed half way) means build. + - name: Check whether dev moved since the last nightly id: check run: | - RECENT=$(git log --since="24 hours ago" --oneline | head -1) - if [ -n "$RECENT" ]; then - echo "has_changes=true" >> $GITHUB_OUTPUT - echo "New commits found — building nightly" + HEAD_SHA=$(git rev-parse HEAD) + NIGHTLY_SHA=$(git rev-parse -q --verify 'refs/tags/nightly^{commit}' || true) + if [ "$HEAD_SHA" != "$NIGHTLY_SHA" ]; then + echo "has_changes=true" >> "$GITHUB_OUTPUT" + echo "dev is at $HEAD_SHA, nightly is at ${NIGHTLY_SHA:-none}: building nightly" else - echo "has_changes=false" >> $GITHUB_OUTPUT - echo "No new commits — skipping nightly build" + echo "has_changes=false" >> "$GITHUB_OUTPUT" + echo "Nightly is already built from $HEAD_SHA: skipping" fi build: From d29681fe0f2d31a05130aa942476c18d70c869bf Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Mon, 23 Nov 2026 08:58:29 -0500 Subject: [PATCH 2/2] Nightly: update the header comment for the new change check Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01M98owbb9iKsAUWvSpjCFTz --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d08b7b9..d85b5bb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,7 +4,7 @@ name: Nightly Build # # The token that can write to the repository never sits next to build-time code (the same rule # as dependency-submission.yml): -# check contents: read. Skips the build when dev has no commit from the last 24 hours. +# check contents: read. Skips the build when dev's tip is the commit the nightly tag points at. # build contents: read. Restores, tests and publishes the App (package and MSBuild code runs # here), packages the zips and SHA256SUMS.txt, and uploads releases/ as an artifact. # publish contents: write. Checks out nothing and runs no repository code. It downloads the