diff options
Diffstat (limited to 'action.yml')
-rw-r--r-- | action.yml | 51 |
1 files changed, 27 insertions, 24 deletions
@@ -85,34 +85,37 @@ runs: } } - $old_values = @{} - Get-ChildItem env: | %{ $old_values.Add($_.Name, $_.Value) } - - $info = Locate-VS - try { - Import-PS $info - } catch { - echo $_ - Import-CMD $info - } - - $new_values = @{} - Get-ChildItem env: | %{ $new_values.Add($_.Name, $_.Value) } + if ('${{ runner.os }}' -ne 'Windows') { + echo 'Not going to set up a Visual Studio shell on ${{ runner.os }}' + } else { + $old_values = @{} + Get-ChildItem env: | %{ $old_values.Add($_.Name, $_.Value) } + + $info = Locate-VS + try { + Import-PS $info + } catch { + echo $_ + Import-CMD $info + } - # Some diagnostics as to which exact variables were modified follows: - echo '----------------------------------------------------------------' - echo 'New variables' - echo '----------------------------------------------------------------' - $new_values.GetEnumerator() | where { -not $old_values.ContainsKey($_.Name) } | Format-List + $new_values = @{} + Get-ChildItem env: | %{ $new_values.Add($_.Name, $_.Value) } - echo '----------------------------------------------------------------' - echo 'Modified variables' - echo '----------------------------------------------------------------' - $new_values.GetEnumerator() | where { $old_values.ContainsKey($_.Name) -and $old_values[$_.Name] -ne $_.Value } | Format-List + # Some diagnostics as to which exact variables were modified follows: + echo '----------------------------------------------------------------' + echo 'New variables' + echo '----------------------------------------------------------------' + $new_values.GetEnumerator() | where { -not $old_values.ContainsKey($_.Name) } | Format-List + echo '----------------------------------------------------------------' + echo 'Modified variables' + echo '----------------------------------------------------------------' + $new_values.GetEnumerator() | where { $old_values.ContainsKey($_.Name) -and $old_values[$_.Name] -ne $_.Value } | Format-List - # Update the current environment: - Get-ChildItem env: | %{ echo "$($_.Name)=$($_.Value)" >> $env:GITHUB_ENV } + # Update the current environment: + Get-ChildItem env: | %{ echo "$($_.Name)=$($_.Value)" >> $env:GITHUB_ENV } + } shell: pwsh branding: icon: star |