Skip to content

Commit

Permalink
Get dotnet version from global.json in github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ringler committed Oct 9, 2024
1 parent 23314db commit fd75fbc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/czishrink_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ jobs:
with:
lfs: true

- name: Get dotnet version from global.json
id: get_dotnet_version
run: |
$global_json = Get-Content -Path "./global.json" | ConvertFrom-Json
$dotnetversion = $global_json.sdk.version
"dotnetversion=$dotnetversion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
shell: pwsh

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: ${{ steps.get_dotnet_version.outputs.dotnetversion }}

- name: Cache nugets
uses: actions/cache@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/czishrink_dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ jobs:
with:
lfs: true

- name: Get dotnet version from global.json
id: get_dotnet_version
run: |
$global_json = Get-Content -Path "./global.json" | ConvertFrom-Json
$dotnetversion = $global_json.sdk.version
"dotnetversion=$dotnetversion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
shell: pwsh

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: ${{ steps.get_dotnet_version.outputs.dotnetversion }}

- name: Get Version from Directory.Build.props
id: getversion
Expand Down

0 comments on commit fd75fbc

Please sign in to comment.