Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/proof-nudges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ jobs:
if: ${{ github.event_name == 'schedule' }}
env:
PROOF_NUDGES_SCHEDULE_TZ: America/Chicago
PROOF_NUDGES_EVENT_SCHEDULE: ${{ github.event.schedule }}
run: |
local_hour="$(TZ="$PROOF_NUDGES_SCHEDULE_TZ" date +%H)"
local_time="$(TZ="$PROOF_NUDGES_SCHEDULE_TZ" date '+%Y-%m-%d %H:%M:%S %Z')"
if [ "$local_hour" = "05" ]; then
local_zone="$(TZ="$PROOF_NUDGES_SCHEDULE_TZ" date +%Z)"
if { [ "$PROOF_NUDGES_EVENT_SCHEDULE" = "0 10 * * *" ] && [ "$local_zone" = "CDT" ]; } ||
{ [ "$PROOF_NUDGES_EVENT_SCHEDULE" = "0 11 * * *" ] && [ "$local_zone" = "CST" ]; }; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
echo "Scheduled proof nudges running at $local_time."
echo "Scheduled proof nudges running for $PROOF_NUDGES_EVENT_SCHEDULE at $local_time."
else
echo "should_run=false" >> "$GITHUB_OUTPUT"
echo "::notice::Skipping scheduled proof nudges at $local_time; waiting for 05:00 America/Chicago."
echo "::notice::Skipping scheduled proof nudges for $PROOF_NUDGES_EVENT_SCHEDULE at $local_time; waiting for the 5:00 AM America/Chicago cron candidate."
fi

- uses: actions/checkout@v6
Expand Down
2 changes: 1 addition & 1 deletion docs/proof-nudges.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Useful options:

The `ClawSweeper Proof Nudges` workflow exposes this as a manual `workflow_dispatch` lane. It defaults to dry-run. Use `execute=true` only after reviewing a dry-run report.

The workflow also includes daily scheduled lanes at `0 10 * * *` and `0 11 * * *`, but it is off by default. Those UTC schedules are guarded by an `America/Chicago` local-time check so only the 5:00 AM Central run continues across daylight saving time changes.
The workflow also includes daily scheduled lanes at `0 10 * * *` and `0 11 * * *`, but it is off by default. Those UTC schedules are guarded by the scheduled cron string and the current `America/Chicago` timezone abbreviation, so only the 5:00 AM Central candidate continues across daylight saving time changes even if GitHub starts the run late.

Scheduled operation uses repository variables:

Expand Down
5 changes: 4 additions & 1 deletion test/clawsweeper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16088,7 +16088,10 @@ test("proof nudge workflow is manual-first and scheduled behind repo vars", () =
assert.match(workflow, /cron: "0 11 \* \* \*"/);
assert.match(concurrency, /clawsweeper-proof-nudges/);
assert.match(job, /PROOF_NUDGES_SCHEDULE_TZ: America\/Chicago/);
assert.match(job, /local_hour=.*date \+%H/);
assert.match(job, /PROOF_NUDGES_EVENT_SCHEDULE: \$\{\{ github\.event\.schedule \}\}/);
assert.match(job, /local_zone=.*date \+%Z/);
assert.match(job, /PROOF_NUDGES_EVENT_SCHEDULE" = "0 10 \* \* \*"/);
assert.match(job, /PROOF_NUDGES_EVENT_SCHEDULE" = "0 11 \* \* \*"/);
assert.match(job, /steps\.central-time\.outputs\.should_run == 'true'/);
assert.match(job, /github\.event_name == 'workflow_dispatch'/);
assert.match(job, /vars\.CLAWSWEEPER_PROOF_NUDGES_SCHEDULED == '1'/);
Expand Down
Loading