question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job outputs doesn't works on Windows runner.

See original GitHub issue

Description

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. image

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 image

In Diag files, we can see the “needs” node does not contains data informations in sub node “outputs”.

image

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:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

12reactions
NeocaseDCostacommented, Oct 25, 2022

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.

9reactions
LeonSnajdrcommented, Dec 21, 2022

Oct 25, 2022

There is also a shorter way to write this use instead of >> $GITHUB_OUTPUT in bash >> $Env:GITHUB_OUTPUT in PowerShell

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found