From 63f55e024cb3462816d74226b989a22c41cf873b Mon Sep 17 00:00:00 2001 From: TypeThe0ry <104051227+TypeThe0ry@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:50:00 +0800 Subject: [PATCH] fix: keep stable publication behind GA workflow --- .github/workflows/release.yml | 4 ++++ scripts/Test-VersionConsistency.ps1 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7322e65..ee221df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,10 @@ jobs: echo 'source_tag must be a strict stable or preview.N/alpha.N/beta.N/rc.N tag' >&2 exit 1 fi + if [[ "$CYC_SOURCE_TAG" != *-* ]]; then + echo 'stable tags must be published only by the protected ga.yml workflow' >&2 + exit 1 + fi # actions/checkout first fetches the annotated tag, then force-updates # refs/tags/ to the checked-out commit for detached HEAD. Verify # the immutable remote tag through a separate local namespace instead diff --git a/scripts/Test-VersionConsistency.ps1 b/scripts/Test-VersionConsistency.ps1 index cc2841c..579217e 100644 --- a/scripts/Test-VersionConsistency.ps1 +++ b/scripts/Test-VersionConsistency.ps1 @@ -209,6 +209,10 @@ function Assert-CycReleaseWorkflowIdentity { if (-not $workflow.Contains($strictStableTagGate)) { throw 'Release workflow source-tag validation is not aligned with the strict prerelease/stable channel contract.' } + if (-not $workflow.Contains('if [[ "$CYC_SOURCE_TAG" != *-* ]]; then') -or + $workflow -notmatch "stable tags must be published only by the protected ga\.yml workflow") { + throw 'The ordinary release publisher must reject stable tags and defer them to the protected GA workflow.' + } $releaseJob = [System.Text.RegularExpressions.Regex]::Match( $workflow,