From 2f5fafbbfffda02440ee243bca03f0502373fdad Mon Sep 17 00:00:00 2001 From: cmurialdo Date: Mon, 20 Mar 2023 17:10:30 -0300 Subject: [PATCH] Keep COMMIT_NUMBER local var as a msbuild parameter given that GITHUB_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 --- .github/workflows/Build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 49e19474a..e9c211092 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -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] @@ -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"