From 64b5d8a0d424030c821b41334f507a424abf0d2c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 4 Jan 2021 06:50:09 +0300 Subject: set %CYGWIN% before installing Cygwin --- action.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'action.yml') diff --git a/action.yml b/action.yml index e463ffc..333e43f 100644 --- a/action.yml +++ b/action.yml @@ -26,16 +26,21 @@ runs: steps: - run: | New-Variable os -Value ('${{ runner.os }}') -Option Constant - New-Variable windows_host -Value ($os -eq 'Windows') -Option Constant - New-Variable x64 -Value ('${{ inputs.platform }}' -eq 'x64') -Option Constant - New-Variable install_dir -Value '${{ inputs.install-dir }}' -Option Constant - New-Variable packages -Value '${{ inputs.packages }}' -Option Constant - if (!$windows_host) { throw "Sorry, installing Cygwin is unsupported on $os" } + shell: pwsh + + - run: | + echo 'CYGWIN=${{ inputs.env }}' >> $env:GITHUB_ENV + shell: pwsh + + - run: | + New-Variable x64 -Value ('${{ inputs.platform }}' -eq 'x64') -Option Constant + New-Variable install_dir -Value '${{ inputs.install-dir }}' -Option Constant + New-Variable packages -Value '${{ inputs.packages }}' -Option Constant function Locate-Choco { $path = Get-Command 'choco' -ErrorAction SilentlyContinue @@ -46,8 +51,6 @@ runs: } } - echo 'CYGWIN=${{ inputs.env }}' >> $env:GITHUB_ENV - $choco = Locate-Choco $choco_params = @( 'install', -- cgit v1.2.3