Skip to content

Commit 0ccd1fe

Browse files
committed
Use the commit message out of the environment variables instead of trying to pass it as a property to MSBuild in the YAML.
1 parent 4db35da commit 0ccd1fe

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

eng/pipelines/templates/jobs/workload-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
/p:DotNetPublishUsingPipelines=true
9595
/p:OfficialBuildId=$(OfficialBuildId)
9696
/p:StabilizePackageVersion=${{ parameters.stabilizePackageVersion }}
97-
/p:SourceBranchCommitMessage=$(SourceBranchCommitMessage)
9897
displayName: 🟣 Build solution
9998
# Name is required to reference the variables created within this build step in other stages.
10099
name: BuildSolution

src/Microsoft.NET.Workloads/Microsoft.NET.Workloads.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,13 @@
160160
</Target>
161161

162162
<Target Name="UpdateRunNameWithWorkloadsVersion" AfterTargets="Build" Condition="'$(TF_BUILD)' != ''">
163-
<!-- From the SetRunName step, we truncate from the 241 chars for the commit message down to 212 to include the workloads version. -->
164-
<!-- Workloads version can be long. This is 29 chars including the delimiter. Eg. 10.0.101-servicing.25563.1 • -->
165-
<Message Text="##vso[build.updatebuildnumber]$(OfficialBuildId) • $(WorkloadsVersion) • $(SourceBranchCommitMessage.Substring(0, 212))" Importance="high" />
163+
<!--
164+
From the SetRunName step, we truncate from the 241 chars for the commit message down to 212 to include the workloads version.
165+
Workloads version can be long. This is 29 chars including the delimiter. Eg. 10.0.101-servicing.25563.1 •
166+
SOURCEBRANCHCOMMITMESSAGE is set to the Azure Pipelines environment within the SetRunName step.
167+
We simply pull it out of the environment variables because trying to set it to an MSBuild property can cause issues in the YAML if the message contains special characters.
168+
-->
169+
<Message Text="##vso[build.updatebuildnumber]$(OfficialBuildId) • $(WorkloadsVersion) • $(SOURCEBRANCHCOMMITMESSAGE.Substring(0, 212))" Importance="high" />
166170
</Target>
167171

168172
</Project>

0 commit comments

Comments
 (0)