From 82418ac6052b0922e88e9d26732af8735f554141 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 20 Feb 2026 11:41:16 +0100 Subject: [PATCH 1/2] Add prerelease version format assertion to test workflow --- .github/workflows/Action-Test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 95d66c2..a5cd36f 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -99,3 +99,13 @@ jobs: if ($installed -ne $requested) { throw "Failed: expected $requested but got $installed" } + + # For prerelease matrix entries, additionally assert the version string + # contains a prerelease identifier so we never silently fall back to stable. + $matrixVersion = '${{ matrix.version }}' + if ($matrixVersion.Trim().ToLower() -eq 'prerelease') { + if ($installed -notmatch '-(preview|rc|alpha|beta)\.') { + throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease identifier (-preview, -rc, -alpha, -beta)." + } + Write-Host "Prerelease check passed: '$installed' contains a prerelease identifier." + } From 3b452afb200518c4e620665521e586f34cb28a92 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:58:10 +0100 Subject: [PATCH 2/2] Simplify prerelease version assertion to hyphen check (#21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prerelease version assertion in the test workflow was matching against a hardcoded list of identifiers (`preview|rc|alpha|beta`), making it brittle and incomplete. ## Changes - **`.github/workflows/Action-Test.yml`**: Replace specific identifier regex with a simple hyphen presence check — consistent with how prerelease detection works elsewhere in `action.yml` ```diff - if ($installed -notmatch '-(preview|rc|alpha|beta)\.') { - throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease identifier (-preview, -rc, -alpha, -beta)." + if ($installed -notmatch '-') { + throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease segment." ``` --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com> --- .github/workflows/Action-Test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index a5cd36f..891c862 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -101,11 +101,11 @@ jobs: } # For prerelease matrix entries, additionally assert the version string - # contains a prerelease identifier so we never silently fall back to stable. + # contains a prerelease segment so we never silently fall back to stable. $matrixVersion = '${{ matrix.version }}' if ($matrixVersion.Trim().ToLower() -eq 'prerelease') { - if ($installed -notmatch '-(preview|rc|alpha|beta)\.') { - throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease identifier (-preview, -rc, -alpha, -beta)." + if ($installed -notmatch '-') { + throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease segment." } - Write-Host "Prerelease check passed: '$installed' contains a prerelease identifier." + Write-Host "Prerelease check passed: '$installed' contains a prerelease segment." }