Skip to content

Commit

Permalink
Keep COMMIT_NUMBER local var as a msbuild parameter given that GITHUB…
Browse files Browse the repository at this point in the history
…_ENV var are not seen by the step that defined the var.

It should be set a power shell var instead of a local var ( $Env:COMMIT_NUMBER = @($(git....)  or keep msbuild explicit parameter /p:COMMIT_NUMBER=$COMMIT_NUMBER
  • Loading branch information
claudiamurialdo committed Mar 20, 2023
1 parent 6c7527a commit 2f5fafb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ jobs:
$COMMIT_MESSAGE = $(git log -1 --pretty=%B)
$LAST_COMMITTER = $(git log -1 --pretty=format:%an)
echo "COMMIT_NUMBER=$COMMIT_NUMBER" >> $env:GITHUB_ENV
$GetFileVersionOutput = dotnet msbuild dotnet/Directory.Build.props /t:GetFileVersionForPackage
$GetFileVersionOutput = dotnet msbuild dotnet/Directory.Build.props /t:GetFileVersionForPackage /p:COMMIT_NUMBER=$COMMIT_NUMBER
"$GetFileVersionOutput" -match "(?<=FileVersion:)(.*)" > $null
$GetFileVersionOutput = $Matches[0]
Expand All @@ -97,6 +96,7 @@ jobs:
Write-Output "Packge version to be used: $NUGET_PACKAGE_VERSION"
echo "NUGET_PACKAGE_VERSION=$NUGET_PACKAGE_VERSION" >> $env:GITHUB_ENV
echo "COMMIT_NUMBER=$COMMIT_NUMBER" >> $env:GITHUB_ENV
echo "IsPrerelease=$IsPrerelease" >> $env:GITHUB_ENV
echo "::set-output name=NUGET_PACKAGE_VERSION::$NUGET_PACKAGE_VERSION"
Expand Down

0 comments on commit 2f5fafb

Please sign in to comment.