parse_env_file discard utf8 bom (#2638)

* parse_env_file discard utf8 bom

* powershell 5 may add the BOM even when explicitly using utf8

* add test + apply to GITHUB_PATH as well

* fix it

* fix powershel 5 syntax

* misc

* fixup

* fix wrong subaction

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2025-02-01 19:17:25 +01:00
committed by GitHub
parent be1b6ee581
commit be51601734
7 changed files with 110 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
on:
push:
defaults:
run:
shell: powershell
jobs:
test:
runs-on: windows-latest
steps:
- run: |
mkdir build
echo '@echo off' | Out-File -FilePath build/test.cmd -Encoding utf8
echo 'echo Hi' | Out-File -FilePath build/test.cmd -Encoding utf8 -Append
mkdir build2
echo '@echo off' | Out-File -FilePath build/test2.cmd -Encoding utf8
echo 'echo test2' | Out-File -FilePath build/test2.cmd -Encoding utf8 -Append
- run: |
echo '${{ tojson(runner) }}'
ls
echo '${{ github.workspace }}'
working-directory: ${{ github.workspace }}\build
- run: |
echo $env:GITHUB_PATH
echo '${{ github.workspace }}\build' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cat $env:GITHUB_PATH
- run: |
echo $env:PATH
test
- run: |
echo "PATH=$env:PATH;${{ github.workspace }}\build2" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- run: |
echo $env:PATH
test
test2