From 88f03af5944f11540eb00c4dcd6d666fac0d061c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 14 Apr 2026 15:17:25 -0700 Subject: [PATCH] Skip duplicate RC retries within same PT hour --- .github/workflows/release-rc.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/release-rc.yml b/.github/workflows/release-rc.yml index a9c224d40..99b602743 100644 --- a/.github/workflows/release-rc.yml +++ b/.github/workflows/release-rc.yml @@ -65,6 +65,22 @@ jobs: exit 0 fi + # Why: the first scheduled run today used the earlier workflow before + # slot markers existed. Keep a tag-time fallback so retries in the + # same PT hour still skip if an RC tag was already created. + latest_rc_tag="$(git for-each-ref --sort=-creatordate --format='%(refname:short) %(creatordate:iso-strict)' 'refs/tags/v*-rc.*' | head -n 1)" + if [[ -n "$latest_rc_tag" ]]; then + latest_rc_tag_name="${latest_rc_tag%% *}" + latest_rc_tag_date="${latest_rc_tag#* }" + latest_rc_slot="$(TZ=America/Los_Angeles date -d "$latest_rc_tag_date" '+%Y-%m-%d-%H')" + + if [[ "$latest_rc_slot" == "${{ steps.slot.outputs.value }}" ]]; then + echo "already_ran=true" >>"$GITHUB_OUTPUT" + echo "reason=latest_rc_tag:$latest_rc_tag_name" >>"$GITHUB_OUTPUT" + exit 0 + fi + fi + echo "already_ran=false" >>"$GITHUB_OUTPUT" - name: Dry run summary @@ -73,6 +89,7 @@ jobs: echo "Dry run only." echo "Current PT slot: ${{ steps.slot.outputs.value }}" echo "Already ran this slot: ${{ steps.existing.outputs.already_ran }}" + echo "Reason: ${{ steps.existing.outputs.reason }}" - name: Create and push RC tag if: steps.existing.outputs.already_ran != 'true' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run)