Job outputs doesn't works on Windows runner.
See original GitHub issueDescription
Hi, I use the sample about job outputs from the GitHub documentation (see code below). When I use “ubuntu-latest” for the job1, I can use job1 outputs into Job2.
When I use my self-hosted windows runner for the job1, I can’t use job1 outputs into Job2. In all tests, I use my self-hosted windows runner for the job2
In Diag files, we can see the “needs” node does not contains data informations in sub node “outputs”.
it looks like a bug 😃. Thanks for your help.
To reproduce
Just change the runner used on job1.
Runner version and OS
Version 2.298.2 on Windows Server 2019 Datacenter.
Script
name: test
on:
pull_request:
branches: [ master ]
jobs:
job1:
runs-on: [self-hosted, windows]
#runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.test }}
output2: ${{ steps.step2.outputs.test }}
steps:
- id: step1
run: echo "test=hello" >> $GITHUB_OUTPUT
- id: step2
run: echo "test=world" >> $GITHUB_OUTPUT
job2:
runs-on: [self-hosted, windows, csd-back]
needs: job1
steps:
- run: echo ${{needs.job1.outputs.output1}} ${{needs.job1.outputs.output2}}
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Outputs for Github Actions on Windows hosted runner
I want to access step outcome from previous job on my Windows self-hosted runner. In order to do so, I use output variables...
Read more >Fix sound or audio problems in Windows
Select Start > Settings > System > Sound > Troubleshoot common sound problems and select Output devices or Input devices. If running the...
Read more >Troubleshooting GitLab Runner
If GitLab Runner is running as a service on Windows, it creates system event logs. To view them, open the Event Viewer (from...
Read more >How to Pass Secrets Between Runners in GitHub Actions
Job outputs containing expressions are evaluated on the runner at the end of each job. Outputs containing secrets are redacted on the runner...
Read more >Jobs
A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In fact the good answers for me is the syntax to use PowerShell instead of Bash. So the answers is use :
run: echo "secondword=world" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
Instead of:run: echo "secondword=world" >> $GITHUB_OUTPUT
I hope this can help someone else.There is also a shorter way to write this use instead of
>> $GITHUB_OUTPUT
in bash>> $Env:GITHUB_OUTPUT
in PowerShell