Files
act_runner/pkg/runner/testdata/windows-add-env-powershell-5/push.yml
ChristopherHX 27511e3003 Parse env file discard utf8 bom (#38)
* powershell 5 may add the BOM even when explicitly using utf8

* add test + apply to GITHUB_PATH as well
2025-02-12 21:26:55 +01:00

49 lines
1.8 KiB
YAML

on:
push:
jobs:
test:
runs-on: windows-latest
steps:
- run: |
echo $env:GITHUB_ENV
echo "key=val" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "key2<<EOF" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "line1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "line2" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "EOF" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
cat $env:GITHUB_ENV
shell: powershell
- run: |
ls env:
if($env:key -ne 'val') {
echo "Unexpected value for `$env:key: $env:key"
exit 1
}
if($env:key2 -ne "line1`nline2") {
echo "Unexpected value for `$env:key2: $env:key2"
exit 1
}
shell: powershell
- run: |
echo $env:GITHUB_ENV
echo "KEY=test" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
# Defect missing append, test is broken!!!
echo "Key=expected" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
shell: powershell
- name: Assert GITHUB_ENV is merged case insensitive
run: exit 1
if: env.KEY != 'expected' || env.Key != 'expected' || env.key != 'expected'
shell: powershell
- name: Assert step env is merged case insensitive
run: exit 1
if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a'
env:
KeY: 'n/a'
shell: powershell
- uses: actions/checkout@v3
- uses: ./windows-add-env-powershell-5/action
- name: Assert composite env is merged case insensitive
run: exit 1
if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a'
shell: powershell