Skip to content

Commit e019b41

Browse files
committed
refactor(tests): update regex patterns to support semver pre-release and build metadata
1 parent ae6afe2 commit e019b41

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/Manifest.tests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ BeforeAll {
44
. $path -Task Build
55
}
66
# NEW: Pre-Specify RegEx Matching Patterns
7-
$gitTagMatchRegEx = 'tag:\s?.(\d+(\.\d+)*)' # NOTE - was 'tag:\s*(\d+(?:\.\d+)*)' previously
8-
$changelogTagMatchRegEx = "^##\s\[(?<Version>(\d+\.){1,3}\d+)\]"
7+
# Matches semantic versioning with optional pre-release and build metadata
8+
# Examples: 1.0.0, 2.0.0-alpha, 2.0.0-alpha.1, 2.0.0+build.123
9+
$gitTagMatchRegEx = 'tag:\s?.(\d+(?:\.\d+)*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?'
10+
$changelogTagMatchRegEx = "^##\s\[(?<Version>(\d+\.){2}\d+)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\]"
911

1012
$moduleName = $env:BHProjectName
1113
$manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest

0 commit comments

Comments
 (0)