Set Environment Variable using Powershell

Could someone help me to set env variable using powershell ? I tried with

... >> $Env:GITHUB_ENV

and

... | Out-File -FilePath $env:GITHUB_ENV -Append

But it’s not show up when I do ${{ env.VAR }}

action run 1
action run 2

Variables written to the GITHUB_ENV file aren’t available in the same step. If you add another step after you should be able to use env.VAR there.

I still cant access it

Solved it, apparently I dont need to use Write-Host or echo before >>
just do
"VAR=TEST" >> $env:GITHUB_ENV

1 Like