We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92fe267 commit b6499ceCopy full SHA for b6499ce
tools/GetBuildVersion.psm1
@@ -5,10 +5,16 @@ Function GetBuildVersion {
5
[string]$BuildNumber
6
)
7
8
+ # If it is a PR, then grab the PR number and append to the base version.
9
+ if ($VersionString -match "refs/pull/(?<pr>\d+)/merge") {
10
+ return "$($BaseVersion)-pr.$($matches['pr'])"
11
+ }
12
+
13
# Process through regex
14
$VersionString -match "(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>\d+))?" | Out-Null
15
- if ($matches -eq $null) {
16
+ # If the version string is the main branch, then we just append the build number
17
+ if ($VersionString -eq "refs/heads/main" -or $matches -eq $null) {
18
return "$($BaseVersion)-build.$($BuildNumber)"
19
}
20
0 commit comments