diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-19 04:48:26 +0300 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-19 05:23:15 +0300 |
| commit | b1bfbd3501b6521d3204b5d060f88a8f6153f945 (patch) | |
| tree | bf2d3869023e1dd20bf395d5dca52f4b6b2b4f39 /.github/actions/check-arch/action.yml | |
| parent | workflows/lint: add a zizmor job (diff) | |
| download | cmake-common-b1bfbd3501b6521d3204b5d060f88a8f6153f945.tar.gz cmake-common-b1bfbd3501b6521d3204b5d060f88a8f6153f945.zip | |
{actions,workflows}: fail on unset environment variables
The $env:NAME syntax fails to produce an error if $NAME is not defined,
regardless of Set-StrictMode/Set-PSDebug.
Also, while I'm at it, clean up the actions/workflows code a little bit.
Diffstat (limited to '')
| -rw-r--r-- | .github/actions/check-arch/action.yml | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/.github/actions/check-arch/action.yml b/.github/actions/check-arch/action.yml index 3dce1d1..dca80f8 100644 --- a/.github/actions/check-arch/action.yml +++ b/.github/actions/check-arch/action.yml @@ -1,7 +1,7 @@ name: Verify architecture description: Verify target architecture inputs: - path: + install_dir: description: Installation directory required: true expected: @@ -11,16 +11,21 @@ runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} ARG_EXPECTED: ${{ inputs.expected }} run: | - $script_path = if ($env:CI_TARGET_PE) { - Join-Path $env:GITHUB_WORKSPACE 'test' 'scripts' 'verify_arch.ps1' + $workspace = (Get-ChildItem env:GITHUB_WORKSPACE).Value + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value + $expected = (Get-ChildItem env:ARG_EXPECTED).Value + + $script_path = if ((Get-ChildItem env:CI_TARGET_PE).Value) { + Join-Path $workspace 'test' 'scripts' 'verify_arch.ps1' } else { - Join-Path $env:GITHUB_WORKSPACE 'test' 'scripts' 'verify_arch.sh' + Join-Path $workspace 'test' 'scripts' 'verify_arch.sh' } - $exe_path = (Join-Path $env:ARG_PATH 'bin' 'foo') + $env:CI_EXE_EXT + $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value + $path = Join-Path $install_dir 'bin' $name - & $script_path $exe_path $env:ARG_EXPECTED + & $script_path $path $expected shell: pwsh |
