From 95db2fd11f55e4a90e8cf6386189b3c6cbf0dc8f Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 14 Apr 2026 15:14:41 -0700 Subject: [PATCH] Harden RC release schedule against dropped cron runs --- .github/workflows/release-rc.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-rc.yml b/.github/workflows/release-rc.yml index 85886cccd..a764da79b 100644 --- a/.github/workflows/release-rc.yml +++ b/.github/workflows/release-rc.yml @@ -3,7 +3,7 @@ name: Schedule RC Release on: workflow_dispatch: schedule: - - cron: '0 3,15 * * *' + - cron: '7,17,27 3,15 * * *' timezone: 'America/Los_Angeles' permissions: @@ -36,11 +36,35 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Sync with latest main - run: git pull --ff-only origin main + run: | + git fetch origin main --tags + git checkout main + git reset --hard origin/main + + - name: Compute RC slot + id: slot + run: | + slot=$(TZ=America/Los_Angeles date '+%Y-%m-%d-%H') + echo "value=$slot" >>"$GITHUB_OUTPUT" + + - name: Skip if this PT release window already ran + id: existing + run: | + # Why: GitHub can delay or drop schedule events, especially near the + # start of the hour. We schedule multiple attempts inside each target + # PT hour and make the release idempotent per hour by embedding a + # slot marker in the release commit message. + if git log origin/main --grep="\\[rc-slot:${{ steps.slot.outputs.value }}\\]" -n 1 --format=%H | grep -q .; then + echo "already_ran=true" >>"$GITHUB_OUTPUT" + exit 0 + fi + + echo "already_ran=false" >>"$GITHUB_OUTPUT" - name: Create and push RC tag + if: steps.existing.outputs.already_ran != 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - npm version prerelease --preid=rc + npm version prerelease --preid=rc -m "release: %s [rc-slot:${{ steps.slot.outputs.value }}]" git push origin main --follow-tags