summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-18 10:33:07 +0300
committerEgor Tensin <egor@tensin.name>2026-10-18 10:33:07 +0300
commit750c2c8ac0abf843d0cb22107dbadf7dde68b325 (patch)
tree4249e38ffec2974be76d5cfd2084774a7bb7d321
parentworkflows/test: add a zizmor job (diff)
downloadsetup-mingw-3.0.3.tar.gz
setup-mingw-3.0.3.zip
fail on unset environment variablesv3.0.3
The $env:NAME syntax fails to produce an error if $NAME is not defined, regardless of Set-StrictMode/Set-PSDebug.
Diffstat (limited to '')
-rw-r--r--action.yml12
1 files changed, 6 insertions, 6 deletions
diff --git a/action.yml b/action.yml
index 0d3c882..2d293ba 100644
--- a/action.yml
+++ b/action.yml
@@ -40,10 +40,10 @@ runs:
$linux_host = '${{ runner.os }}' -eq 'Linux'
$windows_host = '${{ runner.os }}' -eq 'Windows'
- $mingw_version = $env:ARG_VERSION
+ $mingw_version = (Get-ChildItem env:ARG_VERSION).Value
$mingw_version_supplied = $mingw_version -ne ''
- $x64 = $env:ARG_PLATFORM -eq 'x64'
+ $x64 = (Get-ChildItem env:ARG_PLATFORM).Value -eq 'x64'
$prefix32 = 'i686-w64-mingw32'
$prefix64 = 'x86_64-w64-mingw32'
@@ -54,7 +54,7 @@ runs:
if ($path) {
$path.Path
} else {
- Join-Path ${env:ProgramData} 'chocolatey' 'bin' 'choco'
+ Join-Path (Get-ChildItem env:ProgramData).Value 'chocolatey' 'bin' 'choco'
}
}
@@ -169,7 +169,7 @@ runs:
$linux_host = '${{ runner.os }}' -eq 'Linux'
$windows_host = '${{ runner.os }}' -eq 'Windows'
- $cc = $env:ARG_CC -eq '1'
+ $cc = (Get-ChildItem env:ARG_CC).Value -eq '1'
function Link-Exe {
param(
@@ -193,8 +193,8 @@ runs:
}
if ($cc) {
- Link-Exe $env:GCC cc
- Link-Exe $env:GXX c++
+ Link-Exe (Get-ChildItem env:GCC).Value cc
+ Link-Exe (Get-ChildItem env:GXX).Value c++
}
shell: pwsh