File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ param (
2
+ [Parameter (HelpMessage = ' ReleaseTag from the job. Set to "fromBranch" or $null to update using the branch name' )]
3
+ [string ]$ReleaseTag ,
4
+
5
+ [Parameter (HelpMessage = ' The branch name used to update the release tag.' )]
6
+ [string ]$Branch = $env: BUILD_SOURCEBRANCH ,
7
+
8
+ [Parameter (HelpMessage = ' The variable name to put the new release tagin.' )]
9
+ [string ]$Variable = ' ReleaseTag'
10
+ )
11
+
12
+ # Script to set the release tag based on the branch name if it is not set or it is "fromBranch"
13
+ # the branch name is expected to be release-<semver>
14
+ # VSTS passes it as 'refs/heads/release-v6.0.2'
15
+
16
+ if ($ReleaseTag -eq ' fromBranch' -or ! $ReleaseTag )
17
+ {
18
+ $releaseTag = $Branch -replace ' ^.*(release-)'
19
+ $vstsCommandString = " vso[task.setvariable variable=$Variable ]$releaseTag "
20
+ Write-Verbose - Message " setting $Variable to $releaseTag <
59B8
span class="pl-pds">" - Verbose
21
+ Write-Host - Object " ##$vstsCommandString "
22
+ }
Original file line number Diff line number Diff line change
1
+ pwsh -command " .\setReleaseTag.ps1 $* "
You can’t perform that action at this time.
0 commit comments