Skip to content

Commit 3b452af

Browse files
Simplify prerelease version assertion to hyphen check (#21)
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." ``` <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 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>
1 parent 82418ac commit 3b452af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/Action-Test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ jobs:
101101
}
102102
103103
# For prerelease matrix entries, additionally assert the version string
104-
# contains a prerelease identifier so we never silently fall back to stable.
104+
# contains a prerelease segment so we never silently fall back to stable.
105105
$matrixVersion = '${{ matrix.version }}'
106106
if ($matrixVersion.Trim().ToLower() -eq 'prerelease') {
107-
if ($installed -notmatch '-(preview|rc|alpha|beta)\.') {
108-
throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease identifier (-preview, -rc, -alpha, -beta)."
107+
if ($installed -notmatch '-') {
108+
throw "Prerelease validation failed: installed version '$installed' does not contain a prerelease segment."
109109
}
110-
Write-Host "Prerelease check passed: '$installed' contains a prerelease identifier."
110+
Write-Host "Prerelease check passed: '$installed' contains a prerelease segment."
111111
}

0 commit comments

Comments
 (0)